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