n = int(input()) C = list(map(int, input().split())) c1 = 0 cx = 0 for c in C: if c == 1: c1 += 1 if c > 2: cx += 1 if cx == 0: if c1%2 == 1: print('A') else: print('B') else: print('B')