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