#include #include using namespace std; int main(){ int N; cin >> N; int candies[N]; int zero_box = 0; for(int i = 0; i < N; i++){ cin >> candies[i]; if(!candies[i]){ zero_box++; } } sort(candies, candies + N, greater()); if((N - zero_box) % 2 == 1){ for(int i = 0; i < N - zero_box; i++){ if(candies[i] != 1){ cout << "B" << endl; return 0; } } }else{ for(int i = 0; i < (N - zero_box) / 2; i++){ if(candies[i] != 2){ cout << "B" << endl; return 0; } } for(int i = (N - zero_box); i < N - zero_box; i++){ if(candies[i] != 1){ cout << "B" << endl; return 0; } } } if(N == zero_box){ cout << "B" << endl; }else{ cout << "A" << endl; } }