#include using namespace std; using LL = long long; int main(){ // 1. 入力情報取得. int N; cin >> N; LL C[N], candy = 0; for(int i = 0; i < N; i++) cin >> C[i], candy += C[i]; // 2. キャンディーを取っていく. // 2-1. C[i] >= 3 の 箱 があれば, 手番を操作できる B の勝ち. for(int i = 0; i < N; i++){ if(C[i] >= 3){ cout << "B" << endl; return 0; } } // 2-2. C[i] == 2 の 箱 が 2個以上ある場合は, 手番を操作できる B の勝ち. int two = 0; for(int i = 0; i < N; i++) if(C[i] == 2) two++; if(two >= 2){ cout << "B" << endl; return 0; } // 2-3. C[i] == 2 の 箱 が 1個以下の場合は, 箱の合計数で, A, B の勝敗が決まる. if(two <= 1){ if(candy % 2 == 0) cout << "B" << endl; else cout << "A" << endl; } // 3. 出力 ~ 後処理. return 0; }