#include "bits/stdc++.h" using namespace std; int dp[103]; int main() { int N; cin >> N; dp[0] = dp[1] = 0; for (int i = 2; i <= N; i++) { dp[i] = 0; set s; s.insert(dp[i / 2] ^ dp[(i + 1) / 2]); if (i >= 3)s.insert(dp[i / 3] ^ dp[(i + 1) / 3] ^ dp[(i + 2) / 3]); while (s.find(dp[i]) != s.end()) dp[i]++; } if (dp[N] == 0) cout << "B" << endl; else cout << "A" << endl; }