#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 i = 0; i < n; ++i) for(int len = 0; len < n; ++len){ int j = i + len; if(j >= len) break; 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; }