import std.stdio,std.string,std.conv;

int main()
{
	string ans[1024];
	int count = 0;
	string[] _s = readln.chomp.split(" ");
	foreach(i;0.._s.length)
	{
		string s;
		foreach(j;0.._s[i].length)
		{
			if(_s[i][j] != ',' && _s[i][j] != '.')
			{
				s ~= _s[i][j];
			}
		}

		if(2 < s.length && s.length < 7)
		{
			ans[count] = s;
			count++;
		}
	}

	foreach(i;0..count)
	{
		if(i == count - 1)
		{
			ans[i].writeln;
		}
		else
		{
			write(ans[i]," ");
		}
	}
	return 0;
}