#include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <algorithm>
using namespace std;
int main( void )
{
	vector <string> kotae;
	string in;
	getline(cin,in);

	replace( in.begin(), in.end(), ',', ' ' );
	replace( in.begin(), in.end(), '.', ' ' );

	string w;
	istringstream is(in);
	while ( is >> w )
	{
		if ( w.size() > 2 && w.size() < 7 )
			kotae.push_back( w );
	}

	for ( int i = 0; i < kotae.size(); i++ )
	{
		cout << kotae[i];
		if ( i < kotae.size() - 1 )
			cout << " ";
	}
	cout << endl;

	return 0;
}