n=gets.to_i c=gets.split(" ").map(&:to_i) n=c.length-c.count(0) if c.max>2 then puts "B" elsif c.count(2)>1 then puts "B" elsif c.count(2)==1 then if n%2==0 then puts "A" else puts "B" end else if n%2==0 then puts "B" else puts "A" end end