import sys import io, os input = io.BytesIO(os.read(0,os.fstat(0).st_size)).readline def cmb(n, r): if r < 0 or r > n: return 0 r = min(r, n-r) x = 1 for i in range(n-r+1, n+1): x *= i y = 1 for i in range(1, r+1): y *= i return x//y q = int(input()) for _ in range(q): d, x, t = map(int, input().split()) c = cmb(x+d-1, d-1) if c > t: print('ZETUBOU') else: print('AC')