n = int(input()) candies = list(map(int, input().split())) count_k = 0 # number of boxes with exactly 1 candy count_m = 0 # number of boxes with more than 1 candy for c in candies: if c == 1: count_k += 1 elif c > 1: count_m += 1 if count_m == 0: # All boxes are 0 or 1; only 1's matter if count_k % 2 == 1: print("A") else: print("B") else: # At least one box with more than 1; parity of count_k determines outcome if count_k % 2 == 1: print("A") else: print("B")