#include <iostream>
#include <string>
#include <algorithm>

using namespace std;

int main(void){

  string s;

  while( cin >> s ){

    int S = s.size() - 1;
    int f1 = 0;
    int f2 = 0;

    if( s[S] == ',' ){
      f1++;
    }
    if( s[S] == '.' ){
      f2++;
    }
    if( f1 || f2 ){
      S--;
    }
    if( S+1 < 3 || 6 < S+1 ) continue;
    if( s.find("'") != s.npos ) continue;
    for( int i = 0 ; i <= S ; i++ ){
      cout << s[i];
    }
    if(f2) cout << endl;
    else cout << " ";
  }  
  return 0;
}