#include "bits/stdc++.h" using namespace std; using i64 = long long; signed main(){ int n, x; cin >> n >> x; vector v(n); for(auto& w : v) cin >> w; vector> a(n, vector(n, 0)); for(int k = 1; k < n; ++k) for(int i = 0, j = k; j < n; ++i, ++j){ bool f = false; int right_sum = v[j]; for(int right = j - 1; right >= i; --right){ if(!a[i][right]){ f = true; break; } right_sum += v[right]; if(right_sum > x) break; } if(!f){ int left_sum = v[i]; for(int left = i + 1; left <= j; ++left){ if(!a[left][j]){ f = true; break; } left_sum += v[left]; if(left_sum > x) break; } } a[i][j] = f; } cout << (a[0][n - 1] ? "A" : "B") << endl; }