#include <bits/stdc++.h>
#define rep(i,l,n) for(int i=l;i<n;i++)
#define rer(i,l,n) for(int i=l;i<=n;i++)
#define all(a) a.begin(),a.end()
#define o(a) cout<<a<<endl
#define pb(a) push_back(a)
#define mk(a,b) make_pair(a,b)
#define fi first
#define se second
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int,int> pii;

vector<string> split(const string &s,char c){
	vector<string> ret;
	stringstream ss(s);
	string t;
	while(getline(ss,t,c)){
		ret.pb(t);
	}
	return ret;
}

int main(){
	string s;
	getline(cin,s);
	vector<string> s1=split(s,' ');
	rep(i,0,s1.size()){
		vector<string> s2=split(s1[i],',');
		rep(j,0,s2.size()){
			vector<string> s3=split(s2[j],'.');
			rep(k,0,s3.size()){
				if(s3[k].size()>=3 && s3[k].size()<=6){
					cout<<" "<<s3[k];
				}
			}
		}
	}
	cout<<endl;
}