t = int(input())
for _ in range(t):
    x = int(input())
    if x == 0 or x == 45 or x == 90:
        print('Y')
    else:
        print('N')