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