#include<cstdio>
#include<iostream>
#include<algorithm>
#include<vector>
#include<string>
using namespace std;
int main(){
    char data;
    string word[10000];
    int n=0,i=0;
    int flg=0;
    while(scanf("%c",&data)!=EOF){
        if(isalpha(data))word[i]+=data;
        if(data==39||data==','||flg==1){
            flg=1;
            word[i][0]=')';
        }
        if(data==' '){
            flg=0;
            if(word[i][0]!=')')i++;
            word[i]="";
        }
    }
    flg=0;
    for(int j=0;j<=i;j++){
        if(word[j].length()>=3&&word[j].length()<=6){
                if(flg==1)cout<<" ";
                cout<<word[j];
                flg=1;
        }
    }
    return 0;
}