#include <bits/stdc++.h> using namespace std; void mainSolve() { int x,y; cin>>x>>y; if(x>y) cout<<"A"; else cout<<"B"; cout<<endl; } int main() { int t; cin>>t; while(t--) mainSolve(); return 0; }