for j in range(int(input())): d, x, t = map(int, input().split()) 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")