#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 comb[2000][2000]; const ll INF = 10000000000000000; int main() { int Q; cin >> Q; rep (i, 2000) comb[i][0] = 1; rep2 (i, 1, 1999) { rep2 (j, 1, i + 1) { comb[i][j] = comb[i - 1][j] + comb[i - 1][j - 1]; comb[i][j] = min(comb[i][j], INF); } } rep (i, Q) { ll D, X, T; cin >> D >> X >> T; if (comb[D + X - 1][D - 1] <= T) { cout << "AC" << endl; } else { cout << "ZETUBOU" << endl; } } }