#include <cstdio>
#include <cstring>
#include <iostream>
using namespace std;
int main()
{
	char t[1025], r;
	int i = 0, c;
	bool b = false;
	while ((c = getchar()) != '\n')
	{
		r = (unsigned char)c;
		if (r != ' ' && r != '.' && r != ',')
		{
			t[i] = r;
			i++;
		}
		else if (i >= 1)
		{
			t[i] = '\0';
			if (2 < i && i < 7)
			{
				if (b)
					cout << " ";
				cout << t;
				b = true;
			}
			i = 0;
			memset(t, 0, strlen(t));
		}
	}
	cout << endl;
}