#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<cmath>
#include<vector>
#include<string>
#include<algorithm>
#include<utility>
#include<set>
#include<queue>

using namespace std;

typedef pair<int,int> PII;
typedef long long ll;

int main(){

	string line;
	getline(cin,line);

	string ans;
	int j=0;
	for(int i=0;i<line.size();i++){
		if(line[i] == ','||line[i] == ' '||line[i] == '.'){
			if(i-j>=3&&i-j<=6){
				ans += " "+line.substr(j,i-j);
			}
			j = i+1;
		}
	}

	ans = ans.substr(1);
	cout<<ans<<endl;

	return 0;
}