t = int(input()) for _ in range(t): n = int(input()) wp1 = 0 wp2 = 0 for _ in range(n): g = input() if g == 'R S' or g == 'S P' or g == 'P R': wp1 += 1 elif g == 'S R' or g == 'P S' or g == 'R P': wp2 += 1 if wp1 > wp2: print ('Player 1') elif wp2 > wp1: print ('Player 2') else: print ('TIE')