#include using namespace std; int main() { ios_base::sync_with_stdio(0); cin.tie(0); int n; cin >> n; vector g(n+1); for (int i = 1; i <= n; i++) { set mex; if (i >= 2) mex.insert(g[i/2] ^ g[i-i/2]); if (i >= 3) mex.insert(g[i/3] ^ g[i/3+(i%3>0)] ^ g[i/3+(i%3>1)]); for (int j = 0; ; j++) { if (!mex.count(j)) { g[i] = j; break; } } } if (g[n]) cout << "A" << endl; else cout << "B" << endl; return 0; }