import sys sys.setrecursionlimit(10 ** 6) int1 = lambda x: int(x) - 1 p2D = lambda x: print(*x, sep="\n") def II(): return int(sys.stdin.readline()) def MI(): return map(int, sys.stdin.readline().split()) def LI(): return list(map(int, sys.stdin.readline().split())) def LLI(rows_number): return [LI() for _ in range(rows_number)] def main(): n, x = MI() aa = LI() # 閉区間[l,r]が残っている状態で手順が来たとき、勝てるかどうかをDPする # lが現在の位置からどこまで移動できるかを事前計算する lto = [0] * n to = -1 s = 0 for l in range(n): while to < n - 1 and s <= x: to += 1 s += aa[to] lto[l] = to s -= aa[l] # print(lto) # rが現在の位置からどこまで移動できるかを事前計算する rto = [0] * n to = n s = 0 for r in range(n - 1, -1, -1): while to > 0 and s <= x: to -= 1 s += aa[to] rto[r] = to s -= aa[r] # print(rto) # l= r or dpl[l + 1, r] - dpl[nl + 1, r] < nl - l: win = 1 # rを動かすとき nr = rto[r] # 最遠の遷移先 if nr <= l or dpr[l, r - 1] - dpr[l, nr - 1] < r - nr: win = 1 # 表を更新 dpl[l, r] = dpl[l + 1, r] + win dpr[l, r] = dpr[l, r - 1] + win if win: print("A") else: print("B") main()