import std.algorithm, std.conv, std.range, std.stdio, std.string; void main() { auto n = readln.chomp.to!size_t; auto c = readln.split.to!(int[]).filter!"a > 0".array; n = c.length; auto b = c.count!"a >= 2"; if (b == 0) { writeln(n % 2 == 0 ? "B" : "A"); return; } if (b == 1 && c.count!"a == 2" == 1) { writeln(n % 2 == 0 ? "A" : "B"); return; } writeln("B"); }