推荐博客:
http://blog.csdn.net/theprinceofelf/article/details/7225206
#include<iostream>
#include<algorithm>
#include<cstdio>
#include<cstring>
#include<cmath>
using namespace std;
int main(){
int t;
cin>>t;
for(int i=0;i<t;i++){
int a,b;
cin>>a>>b;
if(a>b) swap(a,b);
int k=(b-a)*(1+sqrt(5))/2;
printf("%c\n",k==a?'B':'A');
}
return 0;
}