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