#include using namespace std; int memo[110]; int f(int n) { if (memo[n] != -1) return memo[n]; if (n == 1) return 0; int used[5] = {}; if (n >= 2) { int tmp = f(n / 2) ^ f(n - n / 2); used[tmp] = 1; } if (n >= 3) { int a = n / 3; int b = (n - a) / 2; int c = n - a - b; int tmp = f(a) ^ f(b) ^ f(c); used[tmp] = 1; } for (int i = 0; i < 3; i++) { if (!used[i]) return memo[n] = i; } } int main() { int N; cin >> N; for (int i = 0; i <= N; i++) { memo[i] = -1; } cout << (f(N) ? 'A' : 'B') << endl; }