#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<cstdio>
#include<cmath>
#define pb(in,tmp) in.push_back(tmp)
#define loop(i,a,b) for(int i=a;i<b;i++)
#define rep(i,b) loop(i,0,b)
using namespace std;
int main(){
string in;
bool e=false;
while(cin>>in){
if(in.size()>2&&in.size()<7){
if(e==false){e=true;cout<<in;}
else cout<<" "<<in;
}
}
cout<<endl;
}