#include<bits/stdc++.h>
using namespace std;
int main(){
int n;
string Player1 , Player2;
cin >> n;
for(int i = 0;i < n;i++){
cin >> Player1 >> Player2;
if(Player1 == "Rock" and Player2 == "Scissors"){
cout << "Player1"<< endl;
}
else if(Player1 == "Scissors" and Player2 == "Rock"){
cout << "Player2"<< endl;
}
else if(Player1 == "Rock" and Player2 == "Paper"){
cout << "Player2"<< endl;
}
else if(player1 == "Paper" and Player2 == "Rock"){
cout << "Player1"<< endl;
}
else if (Player1 == "Scissors" and Player2 == "Paper"){
cout << "Player1"<< endl;
}
else if (Pleyer1 == "Paper" and Player2 == "Scissors"){
cout << "Player2"<< endl;
}
else if(Pleyer1 == "Rock" and Player2 == "Rock"){
cout << "Tie"<< endl;
}
else if(Pleyer1 == "Scissors" and Player2 == "Scissors"){
cout << "Tie"<< endl;
}
else if(Pleyer1 == "Paper" and Player2 == "Paper"){
cout << "Tie" << endl;
}
}
return 0;
}