#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; 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.push_back(X); } else { if (c >= 2){ B.push_back(2); B.push_back(1 << (c - 2)); } } } } int M = B.size(); int X = 0; for (int i = 0; i < M; i++){ int cnt = 0; while (B[i] > 1){ int p = pr[B[i]]; while (B[i] % p == 0){ B[i] /= p; cnt++; } X ^= cnt; } } if (X == 0){ cout << 'X' << endl; } else { cout << 'Y' << endl; } }