#include <stdio.h>
#include <stdlib.h>

#define BUFFER_CHUNK 10

int state = 1;

char *buffer = 0;

int hwm = 0;
int bufflen = 0;

/* System Under Test fuer Anwendung der W-Methode */

int input(void) {

    return fgetc(stdin);

} 




void reset(void) {
    hwm = 0;
}

void cat(int c) {

    buffer[hwm++] = (char)c;

}


void truncate(void) {

    hwm--;

}

void print(void) {

    int i;

    for (i=0; i<hwm; i++) 
	putchar((int)(buffer[i]));

    fflush(NULL);

}


int handleState1(int c) { 
	 
    switch ( c ) {

	case '/': 
	    return 2;

	default:
	    return state;

    }

}

int handleState2(int c) { 
	 
    switch ( c ) {

	case '*':
	    reset();
	    return 3;

	case '/': 
	default:
	    return 2;

    }

}


int handleState3(int c) { 
	 
    switch ( c ) {

	case '*':
	    cat(c);
	    return 4;

	case '/': 
	default:
            cat(c);
	    return 3;

    }

}

int handleState4(int c) { 
	 
    switch ( c ) {

	case '*':
	    cat(c);
	    return 4;

	case '/': 
	    truncate();
	    print();
	    return 1;

	default:
	    cat(c);
	    return 3;

    }

}



void mealyAutomaton(int c) {

    /* Check if we need more buffer
       (this works also for empty buffer) */
    if ( hwm == bufflen ) {
	buffer = (char *)realloc(buffer,bufflen + BUFFER_CHUNK);
	bufflen += BUFFER_CHUNK;
    }

    /*-- Now process the state machine --*/
    switch (state) {

	case 1:
	    state = handleState1(c);
	    break;

	case 2:
	    state = handleState2(c);
	    break;

	case 3:
	    state = handleState3(c);
	    break;

	case 4:
	    state = handleState4(c);
	    break;

	default:
	    printf("Illegal state.\n");
	    exit(1);

    }



}

int main() {

    int c;

    /**
     * Process characters until EOF
     * is reached.
     */ 
    while ( (c = input()) != EOF) {

	mealyAutomaton(c);

    }

    putchar('\n');

}
