#include <bits/stdc++.h>

using namespace std;
#define var_dump(x) cerr<<#x<<": "<<x<<'\n'

string a, b, c;
char str[100000];

bool anal() {
		char *p = strtok(str, " ");
		if(p == NULL) return false;
		a = p;
		p = strtok(NULL, " ");
		if(p == NULL) return false;
		b = p;
		p = strtok(NULL, " ");
		if(p == NULL) return false;
		c = p;



		if(a.length() > 2) {
			return false;
		}

		for(int i = 0; i < a.length(); ++i) {
			if(a[i] < 'A' || a[i] > 'Z')
				return false;
		}

		if(a == "B") {
			if(b.length() != 3 && b.length() != 2)
				return false;
		} else {
			if(b.length() != 2) {
				return false;
			}
		}

		for(int i = 0; i < b.length(); ++i) {
			if(b[i] < '0' || b[i] > '9')
				return false;
		}

		if(c.length() != 3)
			return false;

		for(int i = 0; i < c.length(); ++i) {
			if(c[i] < 'A' || c[i] > 'Z')
				return false;
		}
		return true;
}

int main() {
	int n;
	cin >> n;
	cin.get();

	while(n--) {
		cin.getline(str, 100000);
		if(anal()) cout << "Correct!\n";
		else cout << "Incorrect!\n";		
	}

	return 0;
}