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

string word;
bool blank = false;

int main(){
	while(cin >> word){
		if(word.size() <= 2 || 7 <= word.size()) continue;
		if(blank) cout << ' ';
		else blank = true;
		if(word.find(".") != -1 || word.find(",") != -1){
			cout << word.substr(0, word.size() - 1);
		}
		else cout << word;

	}
	cout << endl;
}