#include <iostream>
#include <string>
#include <cctype>
#include <vector>
using namespace std;

bool judge(string s){
	if(!isalpha(s[s.size() - 1])) s.pop_back();
	if(s.size() >= 3 && s.size() <= 6){
		cout << s ;
		return true;
	}
	return false;
}

int main(){
	string s;
	vector<string> vs;
	while(cin >> s){
		vs.push_back(s);
	}
	for(vector<string>::size_type i = 0;
		i < vs.size(); i++)
	{
		if(judge(vs[i])) cout << " ";
		if(i == vs.size() - 1) cout << endl;
	}
	return 0;
}