import java.util.*;

public class prog {
	private static String cor = "Correct!";
	private static String inCor = "Incorrect!";
	
	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		int T = 0;
		try {
			T = in.nextInt();
		}
		catch (Exception ex) {
			
		}
		
		while ((T--)>0) {
			try {
				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);
				}
			}
			catch (Exception ex) {
				
			}
		}
		in.close();
	}
	
	private static int testJud(String jud) {
		if (jud.equals("B")) {
			return 1;
		}
		else if (jud.matches("[A-Z]{2}")) {
			return 0;
		}
		return -1;
	}
	
	private static boolean testNr(String nr, int isB) {
		if ( isB == 1 && nr.matches("[0-9]{3}") ) {
			return true;
		}
		return nr.matches("[0-9]{2}");
	}
	
	private static boolean testS(String s) {
		return s.matches("[A-Z]{3}");
	}
}