#include <iostream>
#include <fstream>
#include <vector>
#include <queue>
#include <utility>
#include <algorithm>
#include <functional>
#include <string>
#include <cstring>
#include <cmath>
#include <map>
#include <set>
#include <stack>
#define NMAX 1000005
#define MOD 666013
#define INF 0x3f3f3f3f
#define pb push_back

using namespace std;

typedef pair<int, int> pii;

//ifstream fin("fisier.in");
//ofstream fout("fisier.out");

char s[25];

inline bool goodChar(char x) {
	return (x>='A'&& x<='Z');
}
inline bool digit(char x) {
	return (x>='0'&& x<='9');
}

int main() {
	int n;

	cin>>n;
	cin.get();

	while(n--) {
		cin.getline(s,25);

		if(s[0] == 'B' && s[1]==' ') {
			if(digit(s[2])&&digit(s[3])&&digit(s[4]) && s[5]==' ' && goodChar(s[6])&&goodChar(s[7])&&goodChar(s[8]) && s[9]==0)
				cout<<"Correct!\n";
			else cout<<"Incorrect!\n";
		}
		else {
			if(goodChar(s[0])&&goodChar(s[1]) && s[2]==' ' && digit(s[3])&&digit(s[4]) && s[5]==' ' && goodChar(s[6])&&goodChar(s[7])&&goodChar(s[8]) && s[9]==0)
				cout<<"Correct!\n";
			else cout<<"Incorrect!\n";
		}
	}


	return 0;
}