#include #include #include using namespace atcoder; using mint = modint; using namespace std; #define rep(i,n) for (int i = 0; i < (n); ++i) #define Inf 1000000001 int main(){ int N; cin>>N; vector dp(N+1,0); for(int i=2;i<=N;i++){ set S; if(i%2==0)S.insert(0); else S.insert(dp[i/2]^dp[(i+1)/2]); if(i>=3){ if(i%3==0)S.insert(dp[i/3]); else if(i%3==1)S.insert(dp[(i+2)/3]); else S.insert(dp[i/3]); } rep(j,1000){ if(!S.count(j)){ dp[i] = j; break; } } } cout<<(dp.back()!=0?"A":"B")<