for j in range(int(input())): d, x, t = map(int, input().split()) if d == 1: if 1 <= t: print("AC") else: print("ZETUBOU") continue x2 = min(x, d - 1) tmp = 1 for i in range(x2): tmp *= (x + d - 1 - i) if i < x2: tmp //= (i + 1) if tmp > t: print("ZETUBOU") break else: print("AC")