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

int main() {

  string s;

  char c;

  string word;

  vector<string> ans;

  bool flag = true;

  getline( cin, s );

  for ( int i = 0; i < s.size(); i++ ) {

    c = s[i];
    if ( c == ' ' || c == '.' || c == ',' ) {

      if ( word.size() >= 3 && word.size() <= 6 && flag ) {
	if ( count( ans.begin(), ans.end(), word ) == 0 ) {
	  ans.push_back( word );
	}
      }
      word = "";
      flag = true;

    }else {

      word += c;

      if ( ( c < 'a' || c > 'z' ) && ( c < 'A' || c > 'Z' ) ) flag = false;

    }

  }

  if ( word.size() >= 3 && word.size() <= 6 && flag ) {
    if ( count( ans.begin(), ans.end(), word ) == 0 ) {
      ans.push_back( word );
    }
  }

  for ( int i = 0; i < ans.size(); i++ ) {

    if ( i != 0 ) cout << " ";
    cout << ans[i];

  }

  cout << endl;

  return 0;

}