#include using namespace std; #define rep(i,x,y) for(int i=(x);i<(y);++i) #define mp(a,b) make_pair((a),(b)) #define debug(x) #x << "=" << (x) #ifdef DEBUG #define _GLIBCXX_DEBUG #define dump(x) std::cerr << debug(x) << " (L:" << __LINE__ << ")" << std::endl #else #define dump(x) #endif typedef long long int ll; typedef pair pii; //template using vec=std::vector; const int INF=1<<30; const long long int INFLL=1LL<<58; const double EPS=1e-9; const int dx[]={1,0,-1,0},dy[]={0,1,0,-1}; template ostream &operator<<(ostream &os, const vector &vec){ os << "["; for (const auto &v : vec) { os << v << ","; } os << "]"; return os; } void Solve(){ static ll comb[4000][4000]; const ll maxi=1e15+1; rep(i,0,4000) comb[i][0]=1; rep(i,0,4000) comb[i][i]=1; rep(i,1,4000){ rep(j,1,i+1){ if(comb[i-1][j-1]>=maxi||comb[i-1][j]>=maxi){ comb[i][j]=maxi; continue; } comb[i][j]=comb[i-1][j-1]+comb[i-1][j]; } } int q; cin >> q; rep(i,0,q){ ll d,x,t; cin >> d >> x >> t; if(comb[x+d-1][d-1]<=t) cout << "AC" << endl; else cout << "ZETUBOU" << endl; } } int main(){ std::ios::sync_with_stdio(false); std::cin.tie(0); Solve(); return 0; }