from math import factorial c = lambda y, x: factorial(y) // factorial(x) // factorial(y - x) q = int(input()) for _ in [0] * q: d, x, t = [int(i) for i in input().split()] print("AC" if c(x + d - 1, x) <= t else "ZETUBOU")