import strutils, math, sequtils for _ in 0 ..< stdin.readLine.parseInt: let t = stdin.readLine if t == "0" or t == "45": echo "Y" else: echo "N"