N = int(input()) C = [int(i) for i in input().split()] count = 0 result = "A" for i in range(N): if C[i] >= 3: result = "B" break if C[i] >= 2: count += 1 if count >= 2: result="B" break print(result)