// 基本テンプレート (縮小版) #include using namespace std; #define rep(i,a,n) for(int (i)=(a); (i)<(n); (i)++) #define repq(i,a,n) for(int (i)=(a); (i)<=(n); (i)++) #define repr(i,a,n) for(int (i)=(a); (i)>=(n); (i)--) #define int long long template void chmax(T &a, T b) {a = max(a, b);} template void chmin(T &a, T b) {a = min(a, b);} template void chadd(T &a, T b) {a = a + b;} typedef pair pii; typedef long long ll; constexpr ll INF = 1001001001001001LL; constexpr ll MOD = 1000000007LL; int Q; int dp[1510][1510]; signed main() { dp[0][0] = 1; rep(i,0,1500) repq(j,0,1500) { dp[i+1][j] = dp[i][j]; if(j > 0) dp[i+1][j] += dp[i+1][j-1]; chmin(dp[i+1][j], INF); } cin >> Q; rep(i,0,Q) { int D, X, T; cin >> D >> X >> T; // printf("value = %lld\n", dp[D][X]); if(dp[D][X] <= T) cout << "AC" << endl; else cout << "ZETUBOU" << endl; } return 0; }