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

vector<string> split(const string& input, char delimiter)
{
  istringstream stream(input);

  string field;
  vector<string> result;
  while (getline(stream, field, delimiter)) {
    result.push_back(field);
  }
  return result;
}

int main() {
  string str;
  int i = 0;

  getline(cin, str);
  replace(str.begin(), str.end(), '.', ' ');
  replace(str.begin(), str.end(), ',', ' ');

  for (const string& s : split(str, ' ')) {
    int size = s.size();
    if(size > 2 && size < 7) {
      cout << s << ' ';
    }
  }
  cout << endl;
  return 0;
}
