#include <iostream>
using namespace std;
int main ()
{
int n;
cin >> n;
while (n -- )
{
string a, b;
cin >> a >> b;
int x, y;
if (a == "Hunter") x = 0;
else if (a == "Bear") x = 1;
else if (a == "Gun") x = 2;
if (b == "Hunter") y = 0;
else if (b == "Bear") y = 1;
else if (b == "Gun") y = 2;
if (x == y) puts("Tie");
else if (x == (y + 1) % 3) puts("Player1");
else puts("Player2");
}
return 0;
}