#include using namespace std; using ll = long long; #define rep(i, n) for (int i = 0; i < (n); i++) #define repr(i, n) for (int i = (n) - 1; i >= 0; i--) #define range(a) a.begin(), a.end() int main() { int N; cin >> N; ll X; cin >> X; vector A(N); rep(i, N) cin >> A[i]; vector S(N + 1); rep(i, N) S[i + 1] = S[i] + A[i]; vector dp(N + 1); vector dps(N + 2); dp[N] = 1; dps[N] = 1; repr(i, N) { // S[j] > X + S[i] int j = upper_bound(range(S), X + S[i]) - S.begin(); if (dps[i + 1] - dps[j] != j - (i + 1)) { dp[i] = 1; } dps[i] = dps[i + 1] + dp[i]; } cout << (dp[0] ? "A" : "B") << endl; }