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