imax = 1500
dp = [[1 for _ in range(imax+1)] for _ in range(imax+1)]
for d in range(2,imax+1):
    dp[d][1] = d
for d in range(2,imax+1):
    for x in range(2,imax+1):
        dp[d][x] = dp[d-1][x]+dp[d][x-1]
Q = int(input())
for _ in range(Q):
    d,x,t = map(int,input().split())
    if dp[d][x]<=t:
        print("AC")
    else:
        print("ZETUBOU")