#include<cstdio>
#include<iostream>
using namespace std;
int cton(string x){//char to number,string是可以当成变量传入的
if(x=="Hunter")return 0;
else if(x=="Bear")return 1;
else return 2;
}
int main(){
int n;
cin>>n;//不会读回车空格
while(n--){
string a,b;
cin>>a>>b;
if(cton(a)==cton(b))cout<<"Tie"<<endl;
else if((cton(a)==(cton(b)+1)%3))cout<<"Player1"<<endl; //到3取模
else cout<<"Player2"<<endl;
}
}
#include<iostream>//*
#include<cstdio>
using namespace std;
int main(){
int t;
char c;
cin >>t;
scanf("%c",&c);//需要把getline前面的回车读走
while(t--){
//其实可以不读一整行
string s;
getline(cin,s);
if(s=="Hunter Gun")cout<<"Player1"<<endl;
else if(s=="Hunter Bear")cout<<"Player2"<<endl;
else if(s=="Bear Hunter")cout<<"Player1"<<endl;
else if(s=="Bear Gun")cout<<"Player2"<<endl;
else if(s=="Gun Bear")cout<<"Player1"<<endl;
else if(s=="Gun Hunter")cout<<"Player2"<<endl;
else cout<<"Tie"<<endl;
}
}