import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.util.Arrays; import java.util.Iterator; public class Main_yukicoder250 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); preCombiLong(3000); int q = sc.nextInt(); for (int i = 0; i < q; i++) { int d = sc.nextInt(); int x = sc.nextInt(); long t = sc.nextLong(); try { if (combinationLong(x + d - 1, x) <= t) { System.out.println("AC"); } else { System.out.println("ZETUBOU"); } } catch (RuntimeException e) { System.out.println("ZETUBOU"); } } sc.close(); } private static long[][] cacheLong; private static void preCombiLong(int size) { // cache size need size * size * 4. // size : ~3000 cacheLong = new long[size + 1][]; for (int i = 0; i <= size; i++) { cacheLong[i] = new long[i + 1]; cacheLong[i][0] = 1; cacheLong[i][i] = 1; } } private static long combinationLong(int n, int r) { r = Math.min(n - r, r); if (cacheLong[n][r] == 0) { cacheLong[n][r] = combinationLong(n - 1, r) + combinationLong(n - 1, r - 1); if (cacheLong[n][r] < 0) { throw new RuntimeException("Long Overflow!"); } } return cacheLong[n][r]; } @SuppressWarnings("unused") private static class Scanner { BufferedReader br; Iterator it; Scanner (InputStream in) { br = new BufferedReader(new InputStreamReader(in)); } String next() throws RuntimeException { try { if (it == null || !it.hasNext()) { it = Arrays.asList(br.readLine().split(" ")).iterator(); } return it.next(); } catch (IOException e) { throw new IllegalStateException(); } } int nextInt() throws RuntimeException { return Integer.parseInt(next()); } long nextLong() throws RuntimeException { return Long.parseLong(next()); } float nextFloat() throws RuntimeException { return Float.parseFloat(next()); } double nextDouble() throws RuntimeException { return Double.parseDouble(next()); } void close() { try { br.close(); } catch (IOException e) { // throw new IllegalStateException(); } } } }