n = int(input()) *a, = map(int,input().split()) v = [0,0,0,0] for ai in a: v[min(ai,3)] += 1 win = 0 if v[3] >= 1: win = 1 if v[2] >= 2: win = 1 if (2*v[2] + v[1])%2 == 0: win = 1 print("AB"[win])