long s;main(i,a){for(;~scanf("%d",&a);)a?s+=!!--i*a:0;puts(s&s+i<2?"A":"B");}