#include<iostream>
#include<string>
#include<stdio.h>
using namespace std;
int main(){
    string a;
	getline(cin,a);
	int i=0,count=0;
	bool t=false;
	while(true){
		if(a[i]==' '||a[i]=='.'||a[i]==','){
			if(count>2&&count<7){
				if(t==true)
					cout<<" ";
				t=true;
				for(int j=i-count;j<i;j++){
					cout<<a[j];
				}
			}
			count=0;
		}
		else
			count++;
		i++;
		if(i==a.size())
			break;
	}
	cout<<endl;
    return 0;
}
 