#include<iostream>
#include<string>
using namespace std;
int main(){
long f=0;
string s;
string::size_type p,q=0;
getline(cin,s);
for(;;){
p=s.find_first_of(" .,",q);
if(2<p-q&&p-q<7){if(f==1)cout<<" ";cout<<s.substr(q,p-q);f=1;}
q=s.find_first_not_of(" .,",p);
if(q==string::npos)break;
}
cout<<endl;
return 0;
}