#include <iostream>
#include <cstdlib>
#include <string>
#include <algorithm>
#include <sstream>

using namespace std;

int main() {
  string line;
  getline( cin, line );
  replace( line.begin(), line.end(), ',', ' ' );
  replace( line.begin(), line.end(), '.', ' ' );
  istringstream iss( line );
  string s1, s2, s3;
  cout << s1 << s2 << s3;
  string word;
  bool is_first = true;
  while( iss >> word ) {
    int len = word.size();
    if( 3 <= len && len <= 6 ) {
      if( !is_first ) { cout << " " << flush; }
      cout << word << flush;
      is_first = false;
    }
  }
  cout << endl;

  return EXIT_SUCCESS;
}