<>;$_=<>;print s/\b1\b//g%2&/^[ 0]*2?( |\b0)*$/?A:B