n = int(input()) def query(inlist): d, x, t = inlist ans = 1 def check(y): if y > t: return -1 else: return 0 x = x + d - 1 d = d - 1 d = min(d,x-d) a, b = 1, 1 check(a//b) if check(a//b) == -1: ans = -1 for i in range(d): a *= x-i b *= d-i if check(a//b) == -1: ans = -1 break if ans == -1: print("ZETUBOU") else: print("AC") return for i in range(n): query([ int(v) for v in input().split() ])