#include using namespace std; typedef long long ll; typedef unsigned long long ull; typedef vector VI; typedef vector VVI; #define REP(i, n) for(int(i)=0;(i)<(n);++(i)) #define FOR(i, f, t) for(int(i)=(f);(i)<(t);(++i)) #define RREP(i, n) for(int(i)=(n)-1;(i)>=0;--(i)) const int MOD = int(1e9+7); int N,M,W,H; int res = 0; const int MAXN = 100; int dp[MAXN+1]; int solve(const int n){ if(n == 1) return 0; if(dp[n] >= 0) return dp[n]; int m1,m2,m3,v1=0,v2=0; m1 = n/2, m2 = n-m1; v1 = 1 - (solve(m1) ^ solve(m2)); if(n>=3){ m1 = n/3, m2 = (n-m1)/2, m3 = n-m1-m2; v2 = 1 - (solve(m1) ^ solve(m2) ^ solve(m3)); } return dp[n] = v1|v2; } int main(){ memset(dp,-1,sizeof(dp)); int N; cin >> N; cout << (solve(N)?"A":"B") << endl; }