import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); // dp[i][j]はi個の変数(≧0)の和がj以下となるような場合の数(10^15+1以上の場合は10^15+1とする) long[][] dp = new long[1500][1501]; // sum[i][j] = dp[i][0] +...+dp[i][j] long[][] sum = new long[1500][1501]; for(int j = 0; j < 1501; j++) { dp[0][j] = 1; sum[0][j] = j + 1; } for(int i = 1; i < 1500; i++) { dp[i][0] = 1; sum[i][0] = 1; for(int j = 1; j < 1501; j++) { dp[i][j] = sum[i - 1][j]; if(sum[i][j - 1] + dp[i][j] >= (long)Math.pow(10, 15) + 1) { sum[i][j] = (long)Math.pow(10, 15) + 1; } else { sum[i][j] = sum[i][j - 1] + dp[i][j]; } } } int Q = sc.nextInt(); for(int i = 0; i < Q; i++) { int d = sc.nextInt(); int x = sc.nextInt(); long t = sc.nextLong(); if(dp[d - 1][x] <= t) { System.out.println("AC"); } else { System.out.println("ZETUBOU"); } } } }