#include using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(nullptr); int n; cin >> n; vector dp(n+1, 0); for (int i = 2; i <= n; i++) { set st; st.insert(dp[i/3]^dp[(i+1)/3]^dp[(i+2)/3]); st.insert(dp[i/2]^dp[(i+1)/2]); while (st.count(dp[i])) dp[i]++; } cout << (dp[n] == 0 ? "B": "A") << "\n"; }