#include<iostream>
#include<string>
using namespace std;
int main(){
	string cent,word,low;
	getline(cin,cent);
	for(int i=0; i<cent.size(); i++){
		if(cent[i] == ' ' || cent[i] == ',' || cent[i] == '.'){
			if(word.size()>2 && word.size()<7){
				if(low == ""){low+=word;}
				else{low+=' ';low+=word;}
			}
			word = "";
		}
		else{word+=cent[i];}
	}
	cout <<low<<endl;
	return 0;
}