#include<iostream>
#include<cstdio>
using namespace std;
char a[1001];
char b[1001];
char kongge[3];
int ans[1001];
int main()
{
int n;
cin>>n;
for(int i=1;i<=n;i++)//"Rock", "Scissors", "Paper"
{ // 石头 剪刀 布
scanf("%s",&a);
scanf("%s",&b);
/*gets(a);
gets(kongge);
gets(b);*/
if(a[0]=='R'&&b[0]=='R')ans[i]=0;
if(a[0]=='S'&&b[0]=='S')ans[i]=0;
if(a[0]=='P'&&b[0]=='P')ans[i]=0;
if(a[0]=='R'&&b[0]=='S')ans[i]=1;
if(a[0]=='R'&&b[0]=='P')ans[i]=2;
if(a[0]=='S'&&b[0]=='R')ans[i]=2;
if(a[0]=='S'&&b[0]=='P')ans[i]=1;
if(a[0]=='P'&&b[0]=='S')ans[i]=2;
if(a[0]=='P'&&b[0]=='R')ans[i]=1;
}
for(int i=1;i<=n;i++)
{
if(ans[i]==0)
{
cout<<"Tie"<<endl;
}
else if(ans[i]==1)
{
cout<<"Player1"<<endl;
}
else if(ans[i]==2)
{
cout<<"Player2"<<endl;
}
}
return 0;
}