n = gets.to_i c_list = gets.split.map(&:to_i) gt2 = c_list.count {|c| c > 2} two = c_list.count(2) one = c_list.count(1) if gt2 > 0 or two > 1 puts 'B' elsif (one + two * 2) % 2 == 0 puts 'B' else puts 'A' end