#include<stdio.h>
#include<string.h>
#define INWORD 1
#define OUTWORD 0

int isAlphabet(char c)
{
	if((c>='a'&&c<='z')||(c>='A'&&c<='Z')||c=='\'')
	{
		return 1;
	}
	else
	{
		return 0;
	}
}

int main()
{
	char sentence[1026];
	char word[7]={'\0'};
	int state=OUTWORD,i,len=0,first=1;

	fgets(sentence,1026,stdin);
	for(i=0;sentence[i]!='\n';i++)
	{
		if(isAlphabet(sentence[i]))
		{
			state=INWORD;
			if(len<6)
			{
				word[len]=sentence[i];
			}
			len++;
		}
		else
		{
			if(state==INWORD)
			{
				if(len>2&&len<7)
				{
					if(first)
					{
						first=0;
					}
					else
					{
						putchar(' ');
					}
					printf("%s",word);
				}
				len=0;
				memset(word,'\0',7);
			}
			state=OUTWORD;
		}
	}
	putchar('\n');
	return 0;
}