#include using namespace std; const int MAX = 100000; int main(){ int N; cin >> N; vector A(N); for (int i = 0; i < N; i++){ cin >> A[i]; } vector pr(MAX + 1, -1); for (int i = 2; i <= MAX; i++){ if (pr[i] == -1){ for (int j = i; j <= MAX; j += i){ pr[j] = i; } } } vector> B(N); for (int i = 0; i < N; i++){ while (A[i] > 1){ int p = pr[A[i]]; int c = 0; while (A[i] % p == 0){ A[i] /= p; c++; } if (p > 2){ int X = p - 1; for (int j = 0; j < c - 1; j++){ X *= p; } B[i].push_back(X); } else { if (c >= 2){ B[i].push_back(2); B[i].push_back(1 << (c - 2)); } } } } int X = 0; for (int i = 0; i < N; i++){ for (int x : B[i]){ int cnt = 0; while (x > 1){ int p = pr[x]; while (x % p == 0){ x /= p; cnt++; } } X ^= cnt; } } if (X == 0){ cout << 'X' << endl; } else { cout << 'Y' << endl; } }