N = int(input()) l = list(map(int, input().split())) bwin_f = 0 two_f = 0 count = 0 for l_i in l: if l_i != 0: count += 1 if l_i > 2: bwin_f += 1 if l_i == 2: two_f += 1 if bwin_f == 0 and two_f == 1 and count % 2 == 0: print("A") elif bwin_f == 0 and two_f == 0 and count % 2 == 1: print("A") else: print("B")