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

using namespace std;

int main(){

	string str;
	getline(cin,str);
	string cuts;
	vector<string> vs;
	for(int i = 0; i < str.size(); i++){
		if((str[i]>='a'&&str[i]<='z')||(str[i]>='A'&&str[i]<='Z')||str[i]==39){
			cuts+=str[i];
		}
		else{
			if(cuts.size()>=3&&cuts.size()<=6){
				vs.push_back(cuts);
			}
			cuts="";
		}
	}
	if(cuts!="")
		vs.push_back(cuts);
	for(int i = 0; i < vs.size(); i++){
		cout<<vs[i];
		if(i==vs.size()-1){
			cout<<endl;
		}
		else
			cout<<" ";
	}
	
	return 0;
}