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

int main(void) {
  string s;
  char c = '\0';
  while(cin >> s) {
    int i;
    for(i = 0; i < s.length(); i++) {
      if(s[i] == ',' || s[i] == '.') {
	s.erase(i);
      }
    }
    if(s.length() <= 2 || s.length() >= 7) continue;
    cout << c << s;
    c = ' ';
  }
  cout << endl;
  return 0;
}