#include <iostream>
using namespace std;
int main(){
int a,b,c,d;
int t;
cin >> t;
while(t--){
scanf("%d%d%d%d",&a,&b,&c,&d);
if(a-b-c+d<0) cout <<"AB//CD"<<endl;
else cout <<"AB//DC"<<endl;
}
return 0;
}
#include <iostream>
using namespace std;
int main(){
int a,b,c,d;
int t;
cin >> t;
while(t--){
scanf("%d%d%d%d",&a,&b,&c,&d);
if(a-b-c+d<0) cout <<"AB//CD"<<endl;
else cout <<"AB//DC"<<endl;
}
return 0;
}