#include<iostream>
int main(){
  std::string list[1000],tmp;
  int c=0,k=0;
  while(std::cin>>tmp) {
    if( (k=tmp.find(",")) != -1)
      tmp = tmp.substr(0,k);
    if( (k=tmp.find(".")) != -1)
      tmp = tmp.substr(0,k);
    if( (tmp.length() > 2) && (tmp.length() < 7))
      list[c]=tmp,c++;
  }
  for(int i=0; i<c; i++){
    std::cout<<list[i];
    if(i<c-1) std::cout<<" ";
  }
  std::cout<<"\n";
}