N = int(input()) C = list(map(int,input().split())) one_count = 0 more_than_two_count = 0 for c in C: if c == 1: one_count += 1 elif c >= 2: more_than_two_count += 1 if more_than_two_count >= 2: print("B") elif more_than_two_count == 1: if one_count == 1: print("A") else: print("B") else: if one_count % 2 == 1: print("A") else: print("B")