box=int(input()) list1=[] line=input() line=line.rstrip().split(" ") win=0 for i in range(len(line)): if int(line[i])>=3: win=1 break elif int(line[i])==0: pass elif int(line[i])==1 or int(line[i])==2: list1.append(int(line[i])) c1=list1.count(1) c2=list1.count(2) if win==1: print("B") elif c2>=2: print("B") elif c2==1: if c1%2==1: print("A") else: print("B") elif c1%2==0: print("B") else: print("A")