#include<bits/stdc++.h>
using namespace std;
//int n;
//cin>>n;
int main(){
int n;
cin>>n;
for(int i=0;i<n;i++){
string a,b;
cin>>a>>b;
if(a[0]==b[0]){
cout<<"Tie"<<endl;
}
else if(a[0]=='R'){
if(b[0]=='S'){
cout<<"Player1"<<endl;
}
else cout<<"Player2"<<endl;
}
else if(a[0]=='S'){
if(b[0]=='R'){
cout<<"Player2"<<endl;
}
else cout<<"Player1"<<endl;
}
else if(a[0]=='P'){
if(b[0]=='S'){
cout<<"Player2"<<endl;
}
else cout<<"Player1"<<endl;
}
return 0;
}
}