#include #include using namespace std; int n; string s; int validate(string s) { int n=s.size(); s+=' '; string judet=""; string numar=""; string sfars=""; int p=0; while(p='A' && s[p]<='Z') judet+=s[p++]; if(judet.size()<1 || judet.size()>2) return 0; if(s[p]!=' ') return 0; ++p; while(p='0' && s[p]<='9') numar+=s[p++]; if(!(numar.size()==2 ||(numar.size()==3 && judet=="B"))) return 0; if(s[p]!=' ') return 0; ++p; while(p='A' && s[p]<='Z') sfars+=s[p++]; if(sfars.size()!=3) return 0; if(p!=n) return 0; return 1; } int main() { cin>>n; getline(cin, s); while(n--) { getline(cin, s); if(validate(s)) cout<<"Correct!\n"; else cout<<"Incorrect!\n"; } return 0; }