q = int(input()) for i in range(q): d, x, t = map(int, input().split()) if d == 1: c = 1 else: c = 1 for i in range(x, x+d): c *= i r = 1 for j in range(1, d): r *= j c //= r if c > t: print('ZETUBO') else: print('AC')