n, x = map(int, input().split()) a = list(map(int, input().split())) ruiseki = [0] * (n + 1) for i in range(n): ruiseki[i + 1] = ruiseki[i] + a[i] def solve(l, r): # [l, r)のシュークリームが残っているときの先手の勝ち負け if r - l == 0: dp[l][r] = True return True if r - l == 1: dp[l][r] = False return False if dp[l][r] is not None: return dp[l][r] tmp = False for newl in range(l + 1, r + 1): if ruiseki[newl] - ruiseki[l] <= x: tmp |= not solve(newl, r) for newr in range(l, r): if ruiseki[r] - ruiseki[newr] <= x: tmp |= not solve(l, newr) dp[l][r] = tmp return tmp dp = [[0] * (n + 1) for i in range(n + 1)] if solve(0, n): print("A") else: print("B")