#include<bits/stdc++.h> using namespace std; int main(){ int n,a,b; cin>>n; while(n){ cin>>a>>b; if(a==b) cout<<"DOGFALL"<<endl; else{ if(a+b<=6){ if(a<b) cout<<"YY"<<endl; else cout<<"XDZ"<<endl; } if(a+b>6){ if(a<b) cout<<"XDZ"<<endl; else cout<<"YY"<<endl; } } n--; } }