#include <iostream>
#include <string>
#include <sstream>
using namespace std;

int main(){
	string buf,tmp,out;
	bool f;
	getline(cin,buf);
	out = "";
	f = false;
	for(int i = 0;i < buf.size();++i){
		if(buf[i] == '.' || buf[i] == ',') buf[i] = ' ';
	}
	stringstream ss;
	ss << buf;
	while(ss >> tmp){
		if(2 < tmp.size() && tmp.size() < 7){
			if(f) out += ' ';
			out += tmp;
			f = true;
		}
	}
	cout << out << endl;
	return 0;
}