myread = lambda : map(int,raw_input().split()) def solver(): T_max = 1234567890123450 pascal_table = [[0 for i in xrange(3010)] for j in xrange(3010)] for i in xrange(3001): pascal_table[i][i] = 1 pascal_table[i][0] = 1 for i in xrange(2,3001): for j in xrange(1,i): pascal_table[i][j] = min(pascal_table[i-1][j-1] + pascal_table[i-1][j], T_max) Q = int(raw_input()) for _ in xrange(Q): D,X,T = myread() D -= 1 X += D #print pascal_table[X][D] if T < pascal_table[X][D]: print "ZETSUBOU" else: print "AC" if __name__ == "__main__": solver()