#include<string>
#include<vector>
#include<iostream>

using namespace std;

bool isDelimiter(char c){return c==' '||c=='.'||c==',';}

int main()
{
	string s;	getline(cin,s);
	vector<string> vs;
	for(int i=0,b=0;i<s.length();i++){
		if(isDelimiter(s[i])){
			if(3<=i-b && i-b<=6)
				vs.push_back(s.substr(b,i-b));
			b=i+1;
		}
	}

	for(int i=0;i<vs.size();i++)	cout<<(i?" ":"")<<vs[i];
	cout<<endl;

	return 0;
}