#include<iostream>
#include<string>
using namespace std;
string s;
bool correctl(char a)
{
    return ('A'<=a && a<='Z');
}
bool correctd(char a)
{
    return ('0'<=a && a<='9');
}
int main()
{
    int n,i,j,ls,ok,buc;
    cin>>n;
    for(i=1;i<=n;i++)
    {
        cin>>s;
        ls=s.size();
        ok=1;
        buc=0;
        if(ls==2)
        {
            if(correctl(s[0])==0 || correctl(s[1])==0)
            {
                ok=0;
            }
        }
        if(ls==1 && s[0]!='B')
        {
            ok=0;
        }
        if(ls==1 && s[0]=='B')
        {
            buc=1;
        }
        if(ls>2)
        {
            ok=0;
        }
        cin>>s;
        ls=s.size();
        if(ls==2)
        {
            if(correctd(s[0])==0 || correctd(s[1])==0)
            {
                ok=0;
            }
        }
        if(ls==3)
        {
            if(correctd(s[0])==0 || correctd(s[1])==0 || correctd(s[1])==0)
            {
                ok=0;
            }
        }
        if(ls!=2 && ls!=3) ok=0;

        cin>>s;
        ls=s.size();
        if(ls==3)
        {
            if(correctl(s[0])==0 || correctl(s[1])==0 || correctl(s[2])==0)
            {
                ok=0;
            }
        }
        if(ls!=3)
        {
            ok=0;
        }
        if(ok==0)
        {
            cout<<"Incorect!\n";
        }
        else
        {
            cout<<"Corect!\n";
        }
    }
}