#include using namespace std; #define rep(i, a, b) for (int i = (a); i < (int)(b); i++) #define rrep(i, a, b) for (int i = (a); i >= (int)(b); i--) #define all(x) (x).begin(), (x).end() using i32 = int32_t; using i64 = int64_t; using f32 = float; using f64 = double; using P = pair; template bool chmin(T& a, T b) { if (a > b) { a = b; return true; } else { return false; } } template bool chmax(T& a, T b) { if (a < b) { a = b; return true; } else { return false; } } template void dump_vec(const vector& v) { auto len = v.size(); rep(i, 0, len) { cout << v[i] << (i == (int)len - 1 ? "\n" : " "); } } struct FastIO { FastIO() { cin.tie(0); ios::sync_with_stdio(false); cout << fixed << setprecision(20); } } FASTIO; //--------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------- signed main() { int t; cin >> t; rep(i, 0, t) { int x; cin >> x; if (x % 45 == 0) { cout << "Y\n"; } else { cout << "N\n"; } } }