#include <iostream>
using namespace std;
int main()
{
int n;
string a, b;
cin >> n;
while (n--)
{
cin >> a >> b;
if (a == b)
cout << "Tie\n";
else if (a[0] == 'R' && b[0] == 'S' || a[0] == 'S' && b[0] == 'P' || a[0] == 'P' && b[0] == 'R')
cout << "Player1\n";
else
cout << "Player2\n";
}
return 0;
}