#include using namespace std; bool bChkMB( const char C ) { if( C >= '0' && C <= '9' ) return false; else if( C >= 'a' && C <= 'z' ) return false; else if( C >= 'A' && C <= 'Z' ) return false; else return true; } int main() { int i; int iPos; char C; char S[ 1000 ]; char T[ 1000 ]; cin >> S; i = 0; iPos = 500; T[ iPos ] = '\0'; while( ( C = S[ i ] ) != '\0' ) { if( bChkMB( C ) ) { iPos -= 3; T[ iPos ] = C; T[ iPos + 1 ] = S[ i + 1 ]; T[ iPos + 2 ] = S[ i + 2 ]; i += 3; } else { iPos--; T[ iPos ] = C; i++; } } cout << (char*) ( T + iPos ) << endl; return 0; }