#include using namespace std; #define FOR(i,a,b) for(int i=(a);i<(b);i++) #define REP(i,n) FOR(i,0,n) #define ALL(v) (v).begin(),(v).end() template inline bool chmax(A &a, B b) { if (a inline bool chmin(A &a, B b) { if (a>b) { a=b; return 1; } return 0; } typedef unsigned long long ull; typedef long long ll; typedef pair pii; typedef pair pll; typedef pair P; const ll INF = 1ll<<29; const ll MOD = 1000000007; const double EPS = 1e-10; int q; ll dp[1501][1501]; ll sum[1501]; int main() { dp[0][0] = 1; REP(i, 1500) { REP(j, 1501) sum[j] = dp[i][j]; FOR(j, 1, 1501) { if (sum[j - 1] == -1 || sum[j] == -1) sum[j] = -1; else { sum[j] += sum[j - 1]; if (sum[j] > 1000000000000000ll) sum[j] = -1; } } REP(j, 1501) { if (sum[j] == -1) dp[i + 1][j] = -1; else dp[i + 1][j] = sum[j]; } } cin >> q; REP(i, q) { ll d, x, t; scanf("%lld %lld %lld", &d, &x, &t); puts(dp[d][x] == -1 || dp[d][x] > t ? "ZETUBOU" : "AC"); } return 0; }