#include <iostream>
#include <cstdio>
using namespace std;
int main(){
string s1,s2;
int n;
scanf("%d",&n);
for(int i=1;i<=n;i++)
{
cin>>s1>>s2;
int x,y;
if (s1=="Gun")x=0;
else if(s1=="Hunter")x=1;
else if(s1=="Bear")x=2;
if (s2=="Gun")y=0;
else if(s2=="Hunter")y=1;
else if(s2=="Bear")y=2;
if((y+1)%3==x)
printf("Player1\n");
else if(x==y)
printf("Tie\n");
else printf("Player2\n");
}
return 0;
}