for _ in range(int(input())): g = int(input()) if g in (0, 45): print('Y') else: print('N')