#include <iostream>
using namespace std;
int main() {
int z,n;
cin>>z;
for(int i=0;i<z;i++){
cin>>n;
cout<<n<<endl;
if (n % 2 == 0) { //Проверка на чётность
cout<<"A"<<endl;
}
else{
cout<<"B"<<endl;
}
}
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKaW50IG1haW4oKSB7CglpbnQgeixuOwoJY2luPj56OwoJZm9yKGludCBpPTA7aTx6O2krKyl7CgkJY2luPj5uOwoJCWNvdXQ8PG48PGVuZGw7CgkJaWYgKG4gJSAyID09IDApIHsgLy/Qn9GA0L7QstC10YDQutCwINC90LAg0YfRkdGC0L3QvtGB0YLRjAogICAgCQljb3V0PDwiQSI8PGVuZGw7CgkJfQoJCWVsc2V7CgkJCWNvdXQ8PCJCIjw8ZW5kbDsKCQl9Cgl9CglyZXR1cm4gMDsKfQ==