#include #define rep(i,a,b) for(int i=a;i<(b);++i) #define erep(i,a,b) for(int i=a;i<=(int)(b);++i) #define per(i,a,b) for(int i=(a);i>(b);--i) #define eper(i,a,b) for(int i=(a);i>=b;--i) #define pb push_back #define mp make_pair #define INF 100100100100 #define MOD 1000000007 #define ALL(x) begin(x),end(x) using namespace std; using ll = long long; using pii = pair; using vii = vector; using vll = vector; templateusing vv = vector; templatebool chmax(T &a, const T &b) { if (abool chmin(T &a, const T &b) { if (b> n; rep(i, 0, n) { int x; cin >> x; if (x) c[i] = x, cnt++; } int sum = accumulate(ALL(c), 0); int one = count(ALL(c), 1); int two = count(ALL(c), 2); if (sum == 0) { cout << "B" << endl; return 0; } if (*max_element(ALL(c)) == 1) { if (sum % 2) cout << "A" << endl; else cout << "B" << endl; return 0; } if (two == 1 && cnt == (one + two) && one % 2) cout << "A" << endl; else cout << "B" << endl; return 0; }