#include using namespace std; # define pb push_back # define mp make_pair # define FORN( a , b , c ) for ( register int a = b ; a <= c ; ++ a ) # define FORNBACK( a , b , c ) for ( register int a = b ; a >= c ; -- a ) bool numaicifre ( string a ) { for ( auto x : a ) if ( ( x >= '0' and x <= '9' ) ) continue; else return 0 ; return 1; } bool numaimari ( string a ) { for ( auto x : a ) { if ( x >= 'A' and x <= 'Z' ) continue ; else return 0; } return 1 ; } int main() { //freopen ( "input" , "r" , stdin ) ; //freopen ( "output" , "w" , stdout ) ; int n ; cin >> n ; while ( n -- ) { string unu , doi ,trei ; cin >> unu >> doi >> trei ; if ( numaicifre( doi ) == 0 ) { cout << "Incorrect!\n" ; continue ; } if ( numaimari( trei ) == 0 ) { cout << "Incorrect!\n" ; continue ; } if ( trei.length() != 3 ){ cout << "Incorrect!\n" ; continue ; } if ( doi.length() > 3 ) { cout << "Incorrect!\n" ; continue ; } if ( doi.length() < 2 ) { cout << "Incorrect!\n" ; continue ; } int ok = 1 ; if ( unu.length() == 1 and unu == "B" ) { goto bun ; } if ( unu.length() == 1 ) { cout << "Incorrect!\n" ; continue ; } for ( auto x : unu ) { if ( ! ( x >= 'A' and x <= 'Z' ) ) { ok = 0 ; break; } } bun : if ( !ok ) { cout << "Incorrect!\n" ; continue ; } if ( doi.length() == 3 ) { if ( unu.length() != 1 ) { cout << "Incorrect!\n" ; continue ; } } cout << "Correct!\n" ; } return 0; }