#include<iostream>
#include<string>
#include<cstring>
#include<cctype>
#include<queue>
#define loop(i,a,b) for(int i=a;i<b;i++)
#define rep(i,a) loop(i,0,a)
using namespace std;

bool check(string s){
	rep(i,s.size()){
		if(!isalpha(s[i]))return true;
	}
	return false;
}

int main(){
	string s;
	getline(cin,s);
	int size=s.size();
	vector<int> bre;
	bre.push_back(0);
	rep(i,size){
		if(!isalpha(s[i]) && s[i]!='\'')bre.push_back(i);
	}
	vector<string> spot;
	rep(i,bre.size()-1){
		spot.push_back(s.substr(bre[i],bre[i+1]-bre[i]));
	}
	//cout<<"debug"<<endl;
	vector<string> ans;
	rep(i,spot.size()){
		rep(j,spot[i].size()){
			if(!isalpha(spot[i][j]) && spot[i][j]!='\'')spot[i].erase(j,1);
		}
		if(spot[i].size()>2 && spot[i].size()<7 /*&& /*!check(spot[i])*/)ans.push_back(spot[i]);
	}
	//cout<<"debug2 "<<ans.size()<<endl;
	cout<<ans[0];
	for(int i=1;i<ans.size();i++){
		cout<<" "<<ans[i];
	}
	cout<<endl;
	return 0;
}