#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,k[2]; m1 = n/2, m2 = n-m1; k[0]=k[1]=0; k[solve(m1)]++; k[solve(m2)]++; if(m1 == 1 && m2 == 1) v1 = 1; if(k[0]%2 == 1) v1 = 1; if(n>=3){ m1 = n/3, m2 = (n-m1)/2, m3 = n-m1-m2; k[0]=k[1]=0; k[solve(m1)]++; k[solve(m2)]++; k[solve(m3)]++; if(m1 == 1 && m2 == 1 && m3 == 1) v1 = 1; if(k[0]%2 == 1) v2 = 1; } return dp[n] = v1|v2; } int main(){ memset(dp,-1,sizeof(dp)); int N; cin >> N; cout << (solve(N)?"A":"B") << endl; }