n=int(input()) c=list(input()) w=c.count("1") if n%2!=0 and w==n: print("A") elif w%2!=0 and c.count("2")==1: print("A") else: print("B")