#include #define rep(i, a) for (int i = 0; i < (a); i++) #define rep2(i, a, b) for (int i = (a); i < (b); i++) #define repr(i, a) for (int i = (a) - 1; i >= 0; i--) #define repr2(i, a, b) for (int i = (b) - 1; i >= (a); i--) #define itall(a) a.begin(), a.end() using namespace std; typedef long long ll; const ll inf = 1e9; const ll mod = 1e9 + 7; const double pi = acos(-1); const double eps = 1e-8; template inline T sq(T a) { return a * a; } template inline T cb(T a) { return a * a * a; } template inline bool umin(T &a, const T &b) { return b < a && (a = b, true); } template inline bool umax(T &a, const T &b) { return a < b && (a = b, true); } ll fact[2000]; double logfact[2000]; ll comb(ll a, ll b) { return fact[a] / fact[b] / fact[a - b]; } ll logcomb(ll a, ll b) { return logfact[a] - logfact[b] - logfact[a - b]; } int main() { int Q; cin >> Q; fact[0] = 1; rep2 (i, 1, 2000) fact[i] = i * fact[i - 1]; logfact[0] = 0; rep2 (i, 1, 2000) logfact[i] = log(i) + logfact[i - 1]; rep (i, Q) { ll D, X, T; cin >> D >> X >> T; if (logcomb(D + X - 1, D - 1) <= log(T) + eps) { if (comb(D + X - 1, D - 1) <= T) { cout << "AC" << endl; } else { cout << "ZETUBOU" << endl; } } else { cout << "ZETUBOU" << endl; } } }