#include<iostream>
#include<string>
using namespace std;
void win(string s,string p){
int a=s.size()-p.size();
if(a==3||a==-2||a==-1)cout<<"Player1"<<endl;
else if(a==0)cout<<"Tie"<<endl;
else cout<<"Player2"<<endl;
}
int main()
{
int n;
string q,w;
cin>>n;
while(n--){
cin>>q>>w;
win(q,w);
}
return 0;
}