#include using namespace std; namespace { typedef double real; typedef long long ll; template ostream& operator<<(ostream& os, const vector& vs) { if (vs.empty()) return os << "[]"; auto i = vs.begin(); os << "[" << *i; for (++i; i != vs.end(); ++i) os << " " << *i; return os << "]"; } template istream& operator>>(istream& is, vector& vs) { for (auto it = vs.begin(); it != vs.end(); it++) is >> *it; return is; } int N; void input() { cin >> N; } int cache[105]; bool win(int n) { if (cache[n] >= 0) return bool(cache[n]); int x, y, z; // div 2 x = n / 2; y = n - x; if ((win(x) ^ win(y)) == 0) return cache[n] = true; // div 3 x = n / 3; y = (n - x) / 2; z = n - x - y; if ((win(x) ^ win(y) ^ win(z)) == 0) return cache[n] = true; return cache[n] = false; } void solve() { memset(cache, -1, sizeof(cache)); cache[1] = false; cache[2] = true; cache[3] = true; cout << (win(N) ? "A" : "B") << endl; } } int main() { input(); solve(); return 0; }