#include<stdio.h>
#include<iostream>
#include<cmath>
#include<string>
using namespace std;
int main(){
int n;
string s1[100], s2[100];
cin >> n;
for (int i = 0; i < n; i++)cin >> s1[i] >> s2[i];
for (int i = 0; i < n; i++) {
if (s1[i] == s2[i])
cout << "Tie" << endl;
else {
if (s1[i] == "Rock" && s2[i] == "Scissors") {
cout << "Player1" << endl;
continue;
}
if (s1[i] == "Scissors" && s2[i] == "paper") {
cout << "Player1" << endl;
continue;
}
if (s1[i] == "Paper" && s2[i] == "Rock") {
cout << "Player1" << endl;
continue;
}
if (s2[i] == "Rock" && s1[i] == "Scissors") {
cout << "Player2" << endl;
continue;
}
if (s2[i] == "Scissors" && s1[i] == "paper") {
cout << "Player2" << endl;
continue;
}
if (s2[i] == "Paper" && s1[i] == "Rock") {
cout << "Player2" << endl;
continue;
}
}
}
return 0;
}