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

int main()
{
	string str;
	while (getline(cin,str))
	{
		int cutp = 0, cnt = 0;
		for (int i = 0; i < str.size(); i++)
		{
			if (str[i] == ',' || str[i] == '.' || str[i]==' ')
			{
				if (3 <= cnt && cnt <= 6)
				{
					if (cutp==0)
					{
						for (int j = cutp; j < cutp+cnt ; j++)
						{
							cout << str[j];
						}
					}
					else
					{
						cout << " ";
						for (int j = cutp; j < cutp + cnt; j++)
						{
							cout << str[j];
						}
					}
				}
				cutp = i + 1;
				cnt = 0;
			}
			else
			{
				cnt++;
			}
		}
		cout << endl;
	}
	return 0;
}