<filename>1 - Beginner/1865.py
# URI Online Judge 1865

N = int(input())

for n in range(N):
    entrada = input().split()[0]
    
    if entrada == 'Thor':
        print('Y')
    else:
        print('N')
<filename>1 - Beginner/1865.py
# URI Online Judge 1865

N = int(input())

for n in range(N):
    entrada = input().split()[0]
    
    if entrada == 'Thor':
        print('Y')
    else:
        print('N')
# URI Online Judge 1865