#include #include #include #include #include #include #include #include #include #include #include #include using namespace std; #define rep(i, n) for (int64_t i = 0; i < (int64_t)(n); i++) #define irep(i, n) for (int64_t i = 0; i <= (int64_t)(n); i++) #define rrep(i, n) for (int64_t i = (n)-1; i >= 0; i--) #define rirep(i, n) for (int64_t i = n; i >= 0; i--) #define chmax(a, b) (a) = max(a, b) #define chmin(a, b) (a) = min(a, b) int64_t fill_ones(int64_t a) { a |= a >> 1; a |= a >> 2; a |= a >> 4; a |= a >> 8; a |= a >> 16; a |= a >> 32; return a; } int64_t msb(int64_t a) { return (fill_ones(a) + 1) >> 1; } unsigned int calc(unsigned int N) { if (N == 0) { return 0; } unsigned int m = msb(N); return (m / 2 <= 1 ? (m - 1) : 0) ^ calc(N - m) ^ ((N - m + 1) % 2 == 1 ? m : 0); } int main() { unsigned int N; cin >> N; cout << (calc(N) == 0 ? "X" : "O") << endl; return 0; }