#include using namespace std; typedef long long ll; typedef vector VI; typedef vector VVI; typedef vector VL; typedef vector VVL; typedef pair PII; #define FOR(i, a, n) for (int i = (int)a; i < (int)n; ++i) #define REP(i, n) FOR(i, 0, n) #define ALL(x) x.begin(), x.end() #define MOD 1000000007 #define INF 1000000000 #define PI 3.14159265359 #define EPS 1e-12 ll dp[2000][2000]; int main(void) { REP(i, 1505) dp[0][i] = 1; REP(i, 1505) dp[i][0] = 1; FOR(i, 1, 1505) { FOR(j, 1, 1505) { if(dp[i][j-1] + dp[i-1][j] > 1000000000000000) dp[i][j] = 1000000000000001; else dp[i][j] = dp[i][j-1] + dp[i-1][j]; } } int q; cin >> q; REP(i, q) { ll d, x, t; cin >> d >> x >> t; //cout << dp[d-2][x-1] << " "; if(dp[d-1][x] > t) cout << "ZETUBOU" << endl; else if(dp[d-1][x] <= t) cout << "AC" << endl; else assert(false); } return 0; }