import java.util.*; public class Exercise120{ public static void main (String[] args){ Scanner sc = new Scanner(System.in); int n = sc.nextInt(); for(int i = 0; i < n; i++){ int d = sc.nextInt(); int x = sc.nextInt(); long t = sc.nextLong(); int b = x + d - 1; long cal = 1; int min = Math.min(x, d - 1); for(int j = 0; j < min; j++){ cal *= (b - j); cal /= (j + 1); if(cal > (long)Math.pow(10, 16)){ break; } } if(cal > t || cal < 1){ System.out.println("ZETUBOU"); }else{ System.out.println("AC"); } } } }