#include using namespace std; const string msg[] = { "WRONG!", "CORRECT (maybe)" }; const string pn[] = { "digi", "petit", "rabi", "gema", "piyo" }; int sym( const string &s ){ for( int i = 0; i < s.size(); ++i ){ if( 'a' <= s[ i ] and s[ i ] <= 'z' ) return 0; if( 'A' <= s[ i ] and s[ i ] <= 'Z' ) return 0; if( '0' <= s[ i ] and s[ i ] <= '9' ) return 0; } return 1; } signed main(){ string buff; while( getline( cin, buff ) ){ if( buff.empty() or buff[ 0 ] == ' ' ){ cout << msg[ 0 ] << endl; continue; } stringstream ss( buff ); string s; int p = 0; string name; int ng = 0; while( ss >> s ){ if( p == 0 ){ name = s; int ok = 0; for( int i = 0; i < 5; ++i ) ok |= name == pn[ i ]; ng |= not ok; break; } ++p; } for( int i = 0; i < buff.size(); ++i ) if( 'A' <= buff[ i ] and buff[ i ] <= 'Z' ) buff[ i ] = buff[ i ] - 'A' + 'a'; if( name.empty() ){ cout << msg[ 0 ] << endl; continue; } string z = buff.substr( name.size() ); if( name == pn[ 0 ] ){ // string z = buff; int ok = 0; for( int i = 0; i + 3 <= z.size(); ++i ) if( z.substr( i, 3 ) == "nyo" and sym( z.substr( i + 3 ) ) ) ok |= ( int ) z.size() - ( i + 3 ) <= 3; ng |= not ok; } else if( name == pn[ 1 ] ){ // string z; // for( int i = 0; i < dict.size(); ++i ) // z += dict[ i ]; int ok = 0; for( int i = 0; i + 3 <= z.size(); ++i ) if( z.substr( i, 3 ) == "nyu" and sym( z.substr( i + 3 ) ) ) ok |= ( int ) z.size() - ( i + 3 ) <= 3; ng |= not ok; } else if( name == pn[ 2 ] ){ // string z; // for( int i = 0; i < dict.size(); ++i ) int ok = 0; for( int i = 0; i < z.size(); ++i ) ok |= 'a' <= z[ i ] and z[ i ] <= 'z', ok |= 'A' <= z[ i ] and z[ i ] <= 'Z', ok |= '0' <= z[ i ] and z[ i ] <= '9'; ng |= not ok; } else if( name == pn[ 3 ] ){ int ok = 0; for( int i = 0; i + 4 <= z.size(); ++i ) if( z.substr( i, 4 ) == "gema" and sym( z.substr( i + 4 ) ) ) ok |= ( int ) z.size() - ( i + 4 ) <= 3; ng |= not ok; } else if( name == pn[ 4 ] ){ int ok = 0; for( int i = 0; i + 3 <= z.size(); ++i ) if( z.substr( i, 3 ) == "pyo" and sym( z.substr( i + 3 ) ) ) ok |= ( int ) z.size() - ( i + 3 ) <= 3; ng |= not ok; } cout << msg[ not name.empty() and not ng ] << endl; } return 0; }