#include <iostream>
#include <sstream>
#include <algorithm>
#include <cstdio>
#include <string>
#include <vector>
#include <cmath>

#define rep(x,to) for(int x=0;x<to;x++)
#define rep2(x,from,to) for(int x=from;x<to;x++)

using namespace std;


int main(void){

string ws,wk;
	while(!cin.eof()){
		getline(cin,ws);
		replace(ws.begin(),ws.end(),',',' ');
		replace(ws.begin(),ws.end(),'.',' ');
		stringstream zz;
		zz << ws;
		while(zz >> wk){
			if(wk.size()>=3 && wk.size()<=6) cout << wk << " ";
		}
		cout << endl;

	}
	return 0;
	
}