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