#include<iostream>
#include<cstring>
using namespace std;
int main(){
  char c[100];
  int count=0;
  int ccount;
  while(cin>>c){
    if(count!=0) cout << ' ';
    ccount = 0;
    count = 0;
    //cout << strlen(c) << endl;
    for(int i=0;i<strlen(c);i++) if(c[i]==','||c[i]=='.') ccount++;
    if(strlen(c)>2&&strlen(c)<7){
      for(int i=0;i<strlen(c)-ccount;i++){
	cout << c[i];
      }
      count++;
    }
  }
  cout << endl;
  return 0;
}