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