#include #include #include #include #include #include #include #include #include #include using namespace std; #define __int64 long long #define long __int64 #define REP(i,a,b) for(int i=a;i 0){ a /= 10; save = a; result ++; } ue = save; return result; } int main(){ int q; int d,x; long t; int maxd; double tester; int adjust = 0; int max_ad; int ue; cin >> q; rep(i,q){ cin >> d >> x >> t; max_ad = func(t, ue); d --; //(d + x - 1)! <= d! * (x-1)! * t : ok maxd = max(d,x); //maxの方を無効化 int j; tester = 1; for(j = d + x; j>maxd; j--){ tester *= j; tester /= (j - maxd); while(true){ if(adjust < max_ad && tester >= 10){ tester /= 10; adjust ++; }else{ break; } } //cout << tester << endl; if(max_ad > adjust || (max_ad == adjust && tester > ue)){ break; } } if(j == maxd){ cout << "AC" << endl; }else{ cout << "ZETUBOU" << endl; } } return 0; }