#include <bits/stdc++.h> using namespace std; char a[4],b[4],c[4]; bool lit() { bool ok=1; if(strlen(c)==3) { for(int i=0;i<strlen(c);i++) if(!isupper(c[i])) ok=0; } else { ok=0; } return ok; } int main() { int t; cin>>t; while(t--) { int kk=1; cin>>a>>b>>c; if(strlen(a)==1&&a[0]=='B') { int ok1=1; int ok2=1; int ok3=lit(); int lg2=strlen(b); if(lg2!=2&&lg2!=3) ok2=0; for(int i=0;i<lg2;i++) { if(!isdigit(b[i])) ok2=0; } if(ok1&&ok2&&ok3) cout<<"Correct"<<'\n'; else cout<<"Incorrect"<<'\n'; kk=0; } else { if(strlen(a)==2) { int ok1=1; int ok2=1; int ok3=lit(); int lg2=strlen(b); if(lg2!=2) ok2=0; for(int i=0;i<lg2;i++) { if(!isdigit(b[i])) ok2=0; } int lg1=strlen(a); if(lg1!=2) ok1=0; for(int i=0;i<lg1;i++) { if(!isupper(a[i])) ok1=0; } if(ok1&&ok2&&ok3) cout<<"Correct"<<'\n'; else cout<<"Incorrect"<<'\n'; } else { cout<<"Incorrect"<<'\n'; } } } return 0; }