#include<bits/stdc++.h>

using namespace std;

int main(){

  string search;
  string result;
  
  getline(cin,search);

  for(int i=0;;++i){
	
	if(search[i]=='.'){
	  if(result.size() >= 3 && result.size() <= 6)
		cout<<result<<' ';
	  cout<<endl;
	  break;
	}
   
	else if(search[i]==' '){
	  if(result.size() >= 3 && result.size() <= 6)
		cout<<result<<' ';
	  result.clear();
	}

	else if((search[i]>='a' && search[i]<='z') ||
			(search[i]>='A' && search[i]<='Z') ||
			(search[i]>='0' && search[i]<='9') ||
			search[i] == '\''){
	  result.push_back(search[i]);
	}

	
  }
  
}

