#include <stdio.h>
#include <string.h>

int main(void) {

char input [1000]; 

char* token;
fgets(input, 1000, stdin);

printf("%s\n", input);

token = strtok (input," ,.");

while (token != NULL){
    printf("%s\n",token);
    token = strtok(NULL, " ,.");
}

	return 0;
}
