#include<iostream>
#include<string>
using namespace std;
int main()
{
	string s;
	string ma;
	while (cin>>s){
		int len = s.size();
		if (s[len-1] == '.'||s[len-1]==','){
			s[len-1] = '\0';
			len--;
		}
		if (len >= 3 &&len <= 6){
			ma += s;
			ma += " ";
		}	
	}
	ma[ma.size() - 1] = '\0';
	cout << ma << endl;
}