#include #include #include #include #define ll long long using namespace std; int N, X; vector v; char memo[5005][5005]; bool solve(int l, int r) { if(memo[l][r] != '-'){ if(memo[l][r] == 'l') return false; else return true; } if(l==r){ return false; } bool canwin = false; ll sum = 0; for(int i=l; i X) break; if(!solve(i+1, r)) canwin = true; } sum = 0; for(int i=r; i>l; i--){ sum += v[i]; if(sum > X) break; if(!solve(l, i-1)) canwin = true; } if(canwin){ memo[l][r] = 'w'; return true; }else{ memo[l][r] = 'l'; return false; } } int main(){ cin >> N >> X; for(int i=0; i> a; v.push_back(a); } for(int i=0; i<5005; i++){ for(int j=0; j<5005; j++){ memo[i][j] = '-'; } } if(solve(0, N-1)) cout << "A" << endl; else cout << "B" << endl; return 0; }