#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 i = 0; i < q; i++){ int d, x; ll t; scanf("%d %d %lld", &d, &x, &t); for(int j = 0; j <= d; j++){ for(int k = 0; k <= x; k++){ dp[j][k] = 0; } } dp[0][0] = 1; for(int j = 0; j < d; j++){ dp[j+1][0] = 1; for(int k = 1; k <= x; k++){ dp[j+1][k] = dp[j][k] + dp[j+1][k-1]; } } if(dp[d][x] >= 0 && t >= dp[d][x])cout << "AC" << endl; else cout << "ZETUBOU" << endl; } return 0; }