#include #include #include using namespace std; typedef vector VLL; typedef vector VVLL; VVLL pascal; const long long INF = 1e16; const int PASCAL_MAX = 3000; void make_pascal() { pascal.assign(PASCAL_MAX + 1, VLL(PASCAL_MAX + 1, INF)); pascal[0][0] = 1; for (int i = 1; i <= PASCAL_MAX; i++) { pascal[i][0] = 1; pascal[i][i] = 1; for (int j = 1; j < i; j++) { pascal[i][j] = min(INF, pascal[i - 1][j - 1] + pascal[i - 1][j]); } } } int main() { make_pascal(); int q, d, x; long long t; cin >> q; vector ok(q); for (int i = 0; i < q; i++) { cin >> d >> x >> t; d--; ok[i] = (pascal[d+x][x] <= t); } for (int i = 0; i < q; i++) { cout << (ok[i] ? "AC" : "ZETUBOU") << endl; } return 0; }