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