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


int main(){
    string s;
    string ans;
    while (cin >> s){
	if (s[s.size()-1] == ',' || s[s.size()-1] == '.')
	    s = s.substr(0, s.size()-1);
	if (3 <= s.size() && s.size() <= 6){
	    ans += " " + s;
	}
    }
    cout << ans.substr(1, ans.size()-1) << endl;
}