#include #define MOD 1000000007LL using namespace std; typedef long long ll; typedef pair P; int dp[101]; int solve(int v){ if(dp[v]!=-1)return dp[v]; set si; si.insert(solve(v/2)^solve((v+1)/2)); si.insert(solve(v/3)^solve((v+1)/3)^solve((v+2)/3)); int res=0; for(set::iterator it=si.begin();it!=si.end();it++){ if((*it)!=res)break; res++; } dp[v]=res; return res; } int main(void){ int n; memset(dp,-1,sizeof(dp)); dp[1]=0; dp[2]=1; scanf("%d",&n); printf("%s\n",(solve(n)!=0)?"A":"B"); return 0; }