import sys, numpy as np n, x = map(int, input().split()) a = np.genfromtxt(sys.stdin, dtype=int) b = np.vstack((np.zeros((2, n), dtype=int), a, a)) while b.shape[1] > 1: b, c = b[:,:-1], b[:,1:] b[0] += c[2] b[1] = c[1] + b[3] b[2] = c[2] b[:2, np.logical_and(b[0]>x, b[1]>x)] = 0 print("A" if b[0,0] else "B")