#include #include using namespace std; const int BUF = 105; int N; void read() { cin >> N; } int rec(int n, int dp[BUF]) { if (n == 0) return 1; if (n == 1) return 0; int &ret = dp[n]; if (ret != -1) return ret; bool S[BUF] = {}; S[rec(n / 2, dp) ^ rec((n + 1) / 2, dp)] = true; if (n >= 3) S[rec(n / 3, dp) ^ rec((n + 1) / 3, dp) ^ rec((n + 2) / 3, dp)] = true; for (int i = 0; i < BUF; ++i) if (!S[i]) return ret = i; } void work() { int dp[BUF]; memset(dp, - 1, sizeof(dp)); cout << (rec(N, dp) == 0 ? 'B' : 'A') << endl; } int main() { read(); work(); return 0; }