for _ in range(int(input())): x=int(input()) if x in [0,45]: print("Y") else: print("N")