#region Header #!/usr/bin/env python3 # from typing import * import sys import io import math import collections import decimal import itertools from queue import PriorityQueue import bisect import heapq def input(): return sys.stdin.readline()[:-1] sys.setrecursionlimit(1000000) #endregion # _INPUT = """3 # 1 3 1 # 2 4 50 # 3 3 9 # """ # sys.stdin = io.StringIO(_INPUT) def f(X, D): if D == 1: return 1 elif D == 2: return X+1 else: return f(X*(X+1)//2, D - 1) def solve(D, X, T): if D == 1: v = 1 elif D == 2: v = X + 1 else: for d in range(D-2): X = (X+1)*(X+2)//2 if X > T: return False v = X return (v <= T) def main(): Q = int(input()) for _ in range(Q): D, X, T = map(int, input().split()) result = solve(D, X, T) if result: print('AC') else: print('ZETUBOU') if __name__ == '__main__': main()