#include <iostream>
#include <string>
#include <vector>

#define rep(i,n) for(int i=0;i<n;i++)

using namespace std;

vector<string> split(const string &str, char delim){
  vector<string> res;
  size_t current = 0, found;
  while((found = str.find_first_of(delim, current)) != string::npos){
    res.push_back(string(str, current, found - current));
    current = found + 1;
  }
  res.push_back(string(str, current, str.size() - current));
  return res;
}

int main()
{
	string s;
	bool flag = false;
	while(cin >> s)
	{
		if(flag)
		{
			cout << " ";
			flag = false;
		}
		rep(i,s.size())
		{
			if(s[i] == ',')
			{
				s[i] = '.';
			}
		}
		vector<string> a = split(s,'.');
		rep(j,a.size())
		{
			if(2 < a[j].size() && a[j].size() < 7)
			{	
				cout << a[j];
				flag = true;
			}
		
		}
	}

	cout << endl;
	return 0;
}