#include <bits/stdc++.h>
using namespace std;

int main() {
  cin.tie(nullptr);
  ios::sync_with_stdio(false);
  int n, x;
  cin >> n >> x;
  vector<int> a(n);
  for (auto&& e : a) {
    cin >> e;
  }
  vector<int> mr(n);
  for (int l = 0; l < n; ++l) {
    int r = l, s = 0;
    while (r < n and s + a[r] <= x) {
      s += a[r++];
    }
    mr[l] = r;
  }
  vector<int> ml(n + 1);
  for (int r = n; r; --r) {
    int l = r, s = 0;
    while (l and s + a[l - 1] <= x) {
      s += a[--l];
    }
    ml[r] = l;
  }
  vector<bitset<5001>> lr(n + 1), rl(n + 1);
  for (int r = 1; r <= n; ++r) {
    for (int l = r; l--; ) {
      lr[l][r] = rl[r][l] = 1;
      if ((int)rl[r]._Find_next(l) <= mr[l]) {
        lr[l][r] = rl[r][l] = 0;
      }
      if ((int)lr[l]._Find_next(ml[r] - 1) < r) {
        lr[l][r] = rl[r][l] = 0;
      }
    }
  }
  cout << (char)('A' + lr[0][n]) << '\n';
}