def solve(): Q = int(input()) D = [0] * Q X = [0] * Q T = [0] * Q for i in range(Q): D[i], X[i], T[i] = map(int, input().split()) MD = max(D) MX = max(X) MT = max(T) dp = [[MT + 1] * (MX + 1) for d in range(MD + 1)] for d in range(1, MD + 1): dp[d][0] = 1 for x in range(1, MX + 1): if d == 1: dp[d][x] = 1 else: dp[d][x] = dp[d][x - 1] + dp[d - 1][x] if dp[d][x] > MT: break for i in range(Q): print('AC' if dp[D[i]][X[i]] <= T[i] else 'ZETUBOU') if __name__ == '__main__': solve()