#include <iostream>
#include <algorithm>
#include <utility>
#include <vector>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <string>
#include <sstream>
#include <cstring>
#include <cstdlib>

using namespace std;

#define ALL(c) c.begin(),c.end()
#define RALL(c) c.rbegin(),c.rend()
#define REP(i,x,y) for(int i=(x);i<(y);++i)
#define MP(a,b) make_pair((a),(b))
#define F_ first
#define S_ second
#define endl '\n'

typedef long long int lli;
typedef pair<int,int> Pi;

const int INF=100000000;
const long long int INF_=100000000000000000;

void Transform(string &str,char ch){
	string::size_type pos=str.find(ch);
	while(pos!=string::npos){
		str.erase(pos);
		pos=str.find(ch);
	}
}

int main(){
	//std::ios::sync_with_stdio(false);
    std::cin.tie(0);
    vector<string> str;
	string tmp;
    while(cin >> tmp) str.push_back(tmp);
	vector<string> ans;
    REP(i,0,str.size()){
		Transform(str[i],'.');
		Transform(str[i],',');
		if(3<=str[i].length()&&str[i].length()<=6) ans.push_back(str[i]);
	}
	REP(i,0,ans.size()){
		cout << ans[i] << (i==ans.size()-1?'\n':' ');
	}
	return 0;
}