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