import sys Q = raw_input() for i in range(Q): D, X, T = map(int, raw_input().split()) a = 1 p = X+1 for j in range(D-1): a *= p p += 1 p = 2 for j in range(D-2): a /= p p += 1 if T < a: print "ZETUBOU" else: print "AC"