#include #define MOD 1000000007 using namespace std; typedef long long ll; ll Q, N; vector fact; vector invs; //1!~N!を計算 vector Factorial(){ vector v{1}; //0! ll f = 1; for(ll i = 1; i <= N; ++i){ f *= i; f %= MOD; v.push_back(f); } return v; } //a^bを計算 ll Pow(ll a,ll b){ ll res = 1; while(b){ if(b % 2) res = (res * a) % MOD; a = (a * a) % MOD; b >>= 1; } return res; } //1!~N!の逆数の計算 vector Reciprocal(){ ll inv = Pow(fact[N], MOD - 2); vector v(N + 1, 1); v[N] = inv; for(ll i = N; i > 1; --i){ inv *= i; inv %= MOD; v[i - 1] = inv; } return v; } //組合せの計算 ll nCr(ll n, ll r){ if(r > n) return 0; return (fact[n] * invs[r] % MOD) * invs[n - r] % MOD; } int main(void){ N = 2000; fact = Factorial(); invs = Reciprocal(); cin >> Q; for(int i = 0; i < Q; ++i){ ll D, X, T; cin >> D >> X >> T; if(nCr(X + D - 1, X) <= T) cout << "AC" << endl; else cout << "ZETUBOU" << endl; } return 0; }