#include using namespace std; typedef long long int ll; typedef pair pii; typedef vector vi; typedef vector > vii; #define rrep(i, m, n) for(int (i)=(m); (i)<(n); (i)++) #define erep(i, m, n) for(int (i)=(m); (i)<=(n); (i)++) #define rep(i, n) for(int (i)=0; (i)<(n); (i)++) #define rrev(i, m, n) for(int (i)=(n)-1; (i)>=(m); (i)--) #define erev(i, m, n) for(int (i)=(n); (i)>=(m); (i)--) #define rev(i, n) for(int (i)=(n)-1; (i)>=0; (i)--) #define vrep(i, c) for(__typeof((c).begin())i=(c).begin(); i!=(c).end(); i++) #define ALL(v) (v).begin(), (v).end() #define mp make_pair #define pb push_back template inline bool minup(T& m, S x){ return m>(T)x ? (m=(T)x, true) : false; } template inline bool maxup(T& m, S x){ return m<(T)x ? (m=(T)x, true) : false; } const int INF = 1000000000; const ll MOD = 1000000007LL; const double EPS = 1E-12; const int MAX_N = 100; int n; int dp[MAX_N + 1]; int grundy(int k) { if(k == 1) return dp[1] = 0; if(k == 2) return dp[2] = 1; if(dp[k] >= 0) return dp[k]; vi S; S.pb(grundy(k / 2) ^ grundy((k + 1) / 2)); S.pb(grundy(k / 3) ^ grundy((k + 1) / 3) ^ grundy((k + 2) / 3)); for(int i=0; ; i++) if(find(ALL(S), i) == S.end()) return dp[k] = i; } int main() { cin >> n; erep(i, 1, n) dp[i] = -1; puts(grundy(n) ? "A" : "B"); return 0; }