import java.io.BufferedReader; import java.io.FileNotFoundException; import java.io.FileReader; import java.io.IOException; import java.util.Scanner; public class Reading { public static void main(String[] args) throws IOException { // Scanner in = new Scanner(new FileReader("input.txt")); Scanner in = new Scanner (System.in) ; int n = Integer.parseInt(in.nextLine()) ; String reg = "" ; for(int i = 1 ; i <= n ; ++i){ reg = in.nextLine().split("\n")[0]; boolean isOK = false ; isOK = reg.matches("^[A-Z]{2} \\d\\d ([A-Z]{3})$"); isOK |= reg.matches("^B \\d\\d\\d? ([A-Z]{3})$"); if(isOK){ System.out.println("Correct!"); }else{ System.out.println("Incorrect!"); } } } }