import java.awt.*; import java.awt.geom.*; import java.io.*; import java.util.*; class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int q = sc.nextInt(); for(int i = 0; i < q; i++) { long d = sc.nextLong(); long x = sc.nextLong(); long t = sc.nextLong(); long sum = 0; for(long j = 0; j < d; j++) { sum += (d-j-1)*x; } sum += 1; if(sum > t) { System.out.println("ZETUBOU"); } else { System.out.println("AC"); } } } }