#include #include using namespace std; int g[110]; int main() { int N; cin >> N; g[2] = 1; for (int x = 3; x <= N; x++) { bool used[110] = {}; if (x % 2 == 0) used[0] = true; else used[g[x / 2] ^ g[x / 2 + 1]] = true; if (x % 3 == 0) used[g[x / 3]] = true; else if (x % 3 == 1) used[g[x / 3 + 1]] = true; else used[g[x / 3]] = true; for (int n = 0; ; n++) { if (!used[n]) { g[x] = n; break; } } } /* for (int n = 2; n <= 10; n++) { cout << n << " "; if (g[n]) cout << "A" << endl; else cout << "B" << endl; cout << g[n] << endl; } */ if (g[N]) cout << "A" << endl; else cout << "B" << endl; return 0; }