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