#include using namespace std; template T gcd(T x, T y) { if (y == 0) return x; return gcd(y, x % y); } template T lcm(T x, T y) { if (x == 0 || y == 0) return 0; return x / gcd(x, y) * y; } int main() { int N; cin >> N; vector C(N); for (int i = 0; i < N; i++) { cin >> C[i]; } sort(C.begin(), C.end(), ::greater()); bool flag = false; for (int i = 0; i < N; i++) { if (C[i] == 0) continue; if (C[i] == 1) flag = !flag; else flag = true; } cout << (flag ? 'B' : 'A') << endl; }