// BCC /* #include #include #include #include #include #include */ // GCC #include using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define rrep(i, n) for (int i = (int)(n) - 1; i >= 0; i--) #define each(i, c) for (__typeof((c).begin()) i = (c).begin(); i != (c).end(); ++i) #define chmin(a, b) a = min(a, b) #define chmax(a, b) a = max(a, b) #define pb push_back #define mp make_pair typedef long long ll; const int INF = 1 << 28; const ll INFLL = 1ll << 56; #define add(a, b) min(a + b, INFLL) ll dp[3001][3001]; int main() { dp[0][0] = 1; rep(i, 3000) rep(j, 3000){ dp[i + 1][j] = add(dp[i + 1][j], dp[i][j]); dp[i + 1][j + 1] = add(dp[i + 1][j + 1], dp[i][j]); } int q; scanf("%d", &q); rep(i, q){ int d, x; ll t; scanf("%d %d %lld", &d, &x, &t); ll s = dp[x + d - 1][d - 1]; puts(s <= t ? "AC" : "ZETUBOU"); } }