#include<iostream>
using namespace std;
int main(void)
{
int x;
cin>>x;
string s1,s2;
while(cin>>s1>>s2)
{
if((s1=="Hunter"&&s2=="Gun")||(s1=="Gun"&&s2=="Bear")||(s1=="Bear"&&s2=="Hunter"))
cout<<"Player1"<<endl;
else if(s1==s2)
cout<<"Tie"<<endl;
else
cout<<"Player2"<<endl;
}
return 0;
}