import sequtils,algorithm,math proc getchar_unlocked():char {. importc:"getchar_unlocked",header: "" .} proc scan(): int = while true: let k = getchar_unlocked() if k < '0': break result = 10 * result + k.ord - '0'.ord let n = scan() let C = newSeqWith(n,scan()).sorted(cmp).filterIt(it>0) if C.len == 0 : echo "B" elif C.len == 1: if C[0] == 1: echo "A" else: echo "B" elif C[^1] >= 2: if C == @[1,2] : echo "A" else: echo "B" else: if C.sum() mod 2 == 1 : echo "A" else: echo "B"