#include<stdio.h>
#include<string.h>
int main(){
int t;
scanf("%d",&t);
char str1[7],str2[7];
for(int i=0;i<t;i++){
scanf("%s %s",str1,str2);
if(strcmp(str1,"Hunter")==0&&strcmp(str2,"Gun")==0||
strcmp(str1,"Gun")==0&&strcmp(str2,"Bear")==0||
strcmp(str1,"Bear")==0&&strcmp(str2,"Hunter")==0)
printf("Player1\n");
else if(strcmp(str1,str2)==0)
printf("Tie\n");
else printf("Player2\n");
}
return 0;
}