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

int main() {
	char str[2048];
	int len;
	char words[216][128];
	int words_size = 0;
	char word_list[216][128];
	int word_list_size = 0;
	int i, j;

	fgets(str, 2048, stdin);
	len = strlen(str);

	for(i = 0; i < len;) {
		if(str[i] == '.' || str[i] == ' ' || str[i] == ',') {
			i++;
			continue;
		}

		else {
			j = 0;
			while(!(str[i + j] == '.' || str[i + j] == ' ' || str[i + j] == ',') && str[i + j]) {
				words[words_size][j] = str[i + j];
				j++;
			}
			words_size++;
			i += j;
		}
	}

	for(i = 0; i < words_size; i++) {
		int flag = 1;
		for(j = 0; j < word_list_size; j++) {
			if(!strcmp(word_list[j], words[i]))
				flag = 0;
		}

		if(flag && 2 < strlen(words[i]) && strlen(words[i]) < 7) {
			strcpy(word_list[word_list_size], words[i]);
			word_list_size++;
		}
	}

	for(i = 0; i < word_list_size; i++) {
		printf("%s", word_list[i]);
		if(i < word_list_size - 1)
			putchar(' ');
	}
	putchar('\n');

	return 0;
}