#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 # 58 62 1000 # 12 34 56 # 987 65 1234 # """ # 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 else: for d in range(D-1): X = X*(X+1)//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()