#include using namespace std; int main(){ #ifndef ONLINE_JUDGE freopen("debug.in", "r", stdin); #endif // ONLINE_JUDGE int t; string A, B, C; cin >> t; while(t--){ cin >> A >> B >> C; if(A.size() > 2){ cout << "Incorrect!\n"; continue; } else { if(A.size() == 1 && A[0] != 'B'){ cout << "Incorrect!\n"; continue; } } if(A.size() == 2 && (!isupper(A[0]) || !isupper(A[1]))){ cout << "Incorrect!\n"; continue; } if(B.size() < 2 || B.size() > 3){ cout << "Incorrect!\n"; continue; } else { if(A.size() == 2){ if(B.size() == 3){ cout << "Incorrect!\n"; continue; } if(B.size() == 2 && (!isdigit(B[0]) || !isdigit(B[1]))){ cout << "Incorrect!\n"; continue; } } else { if(!isdigit(B[0]) || !isdigit(B[1])){ cout << "Incorrect!\n"; continue; } if(B.size() == 3 && !isdigit(B[2])){ cout << "Incorrect!\n"; continue; } } } if(C.size() != 3 || (!isupper(C[0]) || !isupper(C[1]) || !isupper(C[2]))){ cout << "Incorrect!\n"; continue; } cout << "Correct!\n"; } return 0; }