#include #include using namespace std; int g[110]; int main() { int N; cin >> N; g[2] = 1; for (int x = 3; x <= N; x++) { set s; if (x % 2 == 0) s.insert(g[x / 2] ^ g[x / 2]); else s.insert(g[x / 2] ^ g[x / 2 + 1]); if (x % 3 == 0) s.insert(g[x / 3] ^ g[x / 3] ^ g[x ^ 3]); else if (x % 3 == 1) s.insert(g[x / 3] ^ g[x / 3] ^ g[x / 3 + 1]); else s.insert(g[x / 3] ^ g[x / 3 + 1] ^ g[x / 3 + 1]); int num = 0; for (int n : s) { if (num != n) break; num++; } g[x] = num; } if (g[N]) cout << "A" << endl; else cout << "B" << endl; return 0; }