#include<iostream>
#include<string>
#include<vector>
#include<map>
using namespace std;

int main(void){
  string s;
  string res = "",n;
  getline(cin,s);
  s += " ";
  for(int i = 0 ; i < s.size() ; i ++){
    if(s[i] == ' '){
      if(3 <= n.size() && n.size() <= 6)res += n + " ";
      n = "";
    }else{
      if(s[i] != '.' && s[i] != ','){
	n += s[i];
      }
    }
  }	        
  for(int i = 0 ; i < res.size() - 1 ; i ++)
    cout<<res[i];
  cout<<endl;
}