#include <iostream>
#include <algorithm>
#include <string>
#include <sstream>
using namespace std;

const char SEP[2] = {',','.'};

int main() {
  string str;
  getline(cin, str);
  for(int i = 0; i < 2; ++i)
    replace(str.begin(), str.end(), SEP[i], ' ');
  stringstream ss;
  ss << str;
  bool flag = false;
  while(ss >> str) {
    if(str.size() >= 3 && str.size() <= 6){
      if(flag) cout << " ";
      else flag = true;
      cout << str;
    }
  }
  cout << endl;
  return 0;
}