#include using namespace std; #define rep(i,x,y) for(int i=(x);i<(y);++i) #define debug(x) #x << "=" << (x) #ifdef DEBUG #define _GLIBCXX_DEBUG #define show(x) std::cerr << debug(x) << " (L:" << __LINE__ << ")" << std::endl #else #define show(x) #endif typedef long long int ll; typedef pair pii; template using vec=std::vector; const int inf=1<<30; const long long int infll=1LL<<62; const double eps=1e-9; const int dx[]={1,0,-1,0},dy[]={0,1,0,-1}; template ostream &operator<<(ostream &os, const vector &vec){ os << "["; for (const auto &v : vec) { os << v << ","; } os << "]"; return os; } void solve(){ vector memo(101); vector done(101); memo[1]=0; done[1]=true; function grundy=[&](int x){ auto &res=memo[x]; if(done[x]) return res; done[x]=true; set s; if(x%2==0) s.insert(0); else s.insert(grundy(x/2)^grundy(x/2+1)); if(x>=3){ if(x%3==0) s.insert(grundy(x/3)); else if(x%3==1) s.insert(grundy(x/3+1)); else s.insert(grundy(x/3)); } while(s.count(res)!=0) ++res; return res; }; int n; cin >> n; if(grundy(n)) cout << "A" << endl; else cout << "B" << endl; } int main(){ std::cin.tie(0); std::ios::sync_with_stdio(false); cout.setf(ios::fixed); cout.precision(10); solve(); return 0; }