n = int(input()) c = list(map(int, input().split())) xor = 0 for x in c: if x == 1: xor ^= 1 print("A" if xor != 0 else "B")