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

bool judge(string s, int count){
	if(isalpha(s[s.size() - 1])){
		if(s.size() >= 3 && s.size() <= 6){
			if(count != 0) cout << " ";
			cout << s ;
			return true;
		}
		return false;
	}else{
		if(s.size() >= 4 && s.size() <= 7){
			if(count != 0) cout << " ";
			for(int i = 0; i < s.size() - 1; i++){
				cout << s[i];
			}
			return true;
		}
		return false;
	}
}

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