#include using namespace std; typedef long long ll; ll INFL = 1000000000000000010;//10^18 = 2^60 int INF = 2000000000;//10^9 ll MOD = 998244353; vector memo(110, -1); int grundy(int N){ if(memo.at(N) != -1) return memo.at(N); if(N == 1) return 0; if(N == 2) return 1; set s; if(N % 2 == 0){ s.insert(grundy(N/2) ^ grundy(N/2)); }else{ s.insert(grundy(N/2) ^ grundy(N/2+1)); } if(N % 3 == 1){ s.insert(grundy(N/3) ^ grundy(N/3) ^ grundy(N/3+1)); }else if(N % 3 == 2){ s.insert(grundy(N/3) ^ grundy(N/3+1) ^ grundy(N/3+1)); }else{ s.insert(grundy(N/3) ^ grundy(N/3) ^ grundy(N/3)); } int res = 0; while(s.count(res)) res++; return memo.at(N) = res; } int main() { int N; cin >> N; if(grundy(N)){ cout << "A" << endl; }else{ cout << "B" << endl; } }