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(): def win(l,r): if (l,r) in dp:return dp[l,r] if l+1==r:return False if l==r:return True res=False s=0 for nl in range(l+1,r): s+=aa[nl-1] if s>x:break if not win(nl,r): res=True break s=0 for nr in range(r-1,l,-1): if res:break s+=aa[nr] if s>x:break if win(l,nr)==0: res=1 break dp[l,r]=res return res n,x=MI() aa=LI() dp={} if win(0,n):print("A") else:print("B") main()