#include <iostream>
#include <cstring>
using namespace std;
int main()
{
int n;
cin >> n; //定义一个变量;表示有几组数据;
string a,b;
while (n--) //进行n次循环;
{
cin >> a >> b;
if (a==b)
puts("Tie"); //如果动作相同,则平局;
else if(a=="Hunter"&&b=="Gun"||a=="Bear"&&b=="Hunter"||a=="Gun"&&b=="Bear")
puts("Player1"); //列出玩家1胜出的情况,剩下的就是玩家2胜出的情况;
else puts("Player2");
}
return 0;
}