#include<iostream>
#include<iterator>
#include<string>
#include<algorithm>
#include<functional>
#include<cctype>
using namespace std;
struct IsAlpha:unary_function<char, bool>
{bool operator()(char c)const{return isalpha(c)||c=='\'';}};
int main()
{
	string s;
	getline(cin, s);
	string::iterator i1=s.begin(),i2;
	ostream_iterator<char>o(cout);
	int f=0;
	for(;;)
	{
		i2 = find_if(i1,s.end(),not1(IsAlpha()));
		if(i2==s.end()){*o='\n';break;}
		if(i2-i1>2&&i2-i1<7)
			(f++?(*o=' ',f):f),
			copy(i1,i2,o);
		i1=i2+1;
	}
	return 0;
}