#include #include #include #include #include #include #include #include #include #include #include #include using namespace std; using ll = long long; int main() { cin.tie(0); ios::sync_with_stdio(false); int Q; ll D[10007]; ll X[10007]; ll T[10007]; cin >> Q; for (int i = 0; i < Q; i++) { cin >> D[i] >> X[i] >> T[i]; } for (int i = 0; i < Q; i++) { ll prev[1507] = {}; ll cur[1507] = {}; prev[0] = 1; for (int j = 0; j < D[i]; j++) { for (int s = 0; s <= X[i]; s++) { cur[s] = 0; for (int k = 0; k <= s; k++) { cur[s] += prev[k]; if (cur[s] > T[i]) goto zetubou; } } for (int s = 0; s <= X[i]; s++) { prev[s] = cur[s]; } } cout << cur[X[i]] << endl; if (cur[X[i]] <= T[i]) { cout << "AC" << endl; } else { zetubou: cout << "ZETUBOU" << endl; } } return 0; }