#include <iostream>
#include <string>
#include <cctype>
using namespace std;
int n;
string a,b,c;

int main()
{
	cin>>n;
	int i,ok;
	for(i=1;i<=n;i++)
	{
		ok=1;
		cin>>a>>b>>c;
		if(a.size()==1 && a[0]!='B')
			ok=0;
		if(a.size()==2 && (!isupper(a[0]) || isupper(a[1])))
			ok=0;
	//	if(b.size())
		if(b.size()==2 &&(!isdigit(b[0]) || !isdigit(b[1])))
			ok=0;
		if(b.size()==3 &&(!isdigit(b[0]) || !isdigit(b[1]) || !isdigit(b[2])&& a[0]=='B'))
			ok=0;
		if(c.size()==3 && (!isupper(c[0]) || !isupper(c[1]) || !isupper(c[2])))
			ok=0;
		
		if(ok==0)
			cout<<"Incorrect!";
		else
			cout<<"Correct!";
	}
}