#include "bits/stdc++.h" using namespace std; typedef long long ll; #define REP(i, n) for (int i = 0; i < (n); i++) #define INF (1<<30) ll comb[3010][1510]; void calc_comb(ll n, ll k) { comb[0][0] = 0; comb[1][0] = comb[1][1] = 1; for (ll i = 2; i < n; i++) { for (ll j = 0; j < k; j++) { if(i (ll)1e20) comb[i][j]=-1; } } } int main() { calc_comb(3010,1510); ll Q; cin >> Q; vector D(Q), X(Q), T(Q); for(ll i=0; i> D[i] >> X[i] >> T[i]; for (ll i = 0; i < Q; i++) { if (comb[X[i] + D[i] - 1][X[i]] > T[i] || comb[X[i] + D[i] - 1][X[i]] == -1) { cout << "ZETUBOU" << endl; } else { cout << "AC" << endl; } } }