<>;$_=<>;s/2/0/;print s/1\s//g&/^(0\s)*$/?A:B