def solve(): D, X, T = map(int, raw_input().strip().split()) ans = 1 for c in xrange(1, D): r = c + X ans = ans * r / c if ans > T: print("ZETUBOU") return print("AC") Q = input() for i in range(Q): solve()