#include #include #include #include #include #include #include #include #include #include #define ll long long int #define pb push_back #define mk make_pair #define pq priority_queue using namespace std; typedef pair P; typedef pair Pl; const int inf = 1e9; const ll linf = 1LL << 50; ll dp[1501][1501]; int main(int argc, char const* argv[]) { int q; scanf("%d", &q); for(int j = 0; j <= 1500; j++){ for(int k = 0; k <= 1500; k++){ dp[j][k] = 0; } } dp[0][0] = 1; for(int j = 0; j < 1500; j++){ dp[j+1][0] = 1; for(int k = 1; k <= 1500; k++){ if(dp[j][k] >= 0 && dp[j+1][k-1] >= 0)dp[j+1][k] = dp[j][k] + dp[j+1][k-1]; else dp[j+1][k] = -1; if(dp[j+1][k] > 1e15)dp[j+1][k] = -1; } } for(int i = 0; i < q; i++){ int d, x; ll t; scanf("%d %d %lld", &d, &x, &t); if(dp[d][x] >= 0 && t >= dp[d][x])cout << "AC" << endl; else cout << "ZETUBOU" << endl; } return 0; }