#include<iostream>
#include<string>
using namespace std;
int main()
{
	string in;
	getline(cin,in);
	bool f=false;
	string out="";
	for(int i = 0; i < in.size(); ++i)
	{
		if(in[i]==' '||in[i]==','||in[i]=='.')
		{
			if(2<out.size()&&out.size()<7)
			{
				if(f) cout<<" ";
				cout<<out;
				f=true;
			}
			out="";
		}	
		else out+=in[i];
	}
	cout<<endl;
  return 0;
}