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

typedef struct vector_t {
	void **v;
	int length;
	int size;
} vector;

vector new_v() {
	vector a;
	a.length = 0;
	a.size = 8;
	a.v = (void **)malloc(sizeof(void *) * a.size);
	return a;
}

void push_v(vector *a, void *e) {
	if(a->length == a->size) {
		a->size *= 2;
		a->v = (void **)realloc(a->v, sizeof(void *) * a->size);
	}
	a->v[a->length] = e;
	a->length++;
}

void *pop_v(vector *a) {
	a->length--;
	return a->v[a->length];
}

void free_v(vector a) {
	free(a.v);
}

void map_v(vector a, void (*f)(void *)) {
	int i;
	for(i = 0; i < a.length; i++)
		f(a.v[i]);
}

void printer(void *a) {
	printf("%s ", (char *) a);
}

int main(void) {
	vector v = new_v();
	char str[100];
	char *token, *tmp;
	fgets(str, 100, stdin);
	token = strtok(str, " \t\n?!,.;:-_");
	while(token != NULL) {
		tmp = (char *)malloc(sizeof(char) * (strlen(token) + 1));
		strcpy(tmp, token);
		push_v(&v, tmp);
		token = strtok(NULL, " \t\n?!,.;:-_");
	}
	map_v(v, printer);
	map_v(v, free);
	free_v(v);
	return 0;
}
