import java.util.*;

class prog {	
	public static void main(String[] args) throws Exception {
		Scanner in = new Scanner(System.in);
		int T = in.nextInt();
		
		while ((T--)>0) {
			String jud,nr,s;
			jud = in.next();
			nr = in.next();
			s = in.next();
			if (testJud(jud)>=0 && testNr(nr,testJud(jud)) && testS(s)) {
				System.out.println(cor);
			}
			else {
				System.out.println(inCor);
			}
		}
		in.close();
	}
	
	private static String cor = "Correct!";
	private static String inCor = "Incorrect!";
	
	private static int testJud(String jud) {
		if (jud.equals("B")) {
			return 1;
		}
		else if (jud.length()==2 && 'A'<=jud.charAt(0) && jud.charAt(0)<='Z' && 'A'<=jud.charAt(1) && jud.charAt(1)<='Z') {
			return 0;
		}
		return -1;
	}
	
	private static boolean testNr(String nr, int isB) {
		if (isB==1 && nr.length()==3 &&
			'0'<=nr.charAt(0) && nr.charAt(0)<='9' &&
			'0'<=nr.charAt(1) && nr.charAt(1)<='9' &&
			'0'<=nr.charAt(2) && nr.charAt(2)<='9' ) {
			return true;
		}
		else if (nr.length()==2 &&
				 '0'<=nr.charAt(0) && nr.charAt(0)<='9' &&
				 '0'<=nr.charAt(1) && nr.charAt(1)<='9') {
			 return true;
		}
		return false;
	}
	
	private static boolean testS(String s) {
		if (s.length()==3 &&
			'A'<=s.charAt(0) && s.charAt(0)<='Z' &&
			'A'<=s.charAt(1) && s.charAt(1)<='Z' &&
			'A'<=s.charAt(2) && s.charAt(2)<='Z' ) {
			return true;
		}
		return false;
	}
}