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

int main ()
{
    string str;
    getline(cin,str);
    stringstream ss;
    for (int i = 0; i < str.size(); i++) {
        if (str[i] == '.' || str[i] == ',') str[i] = ' ';
    }
    ss << str;
    bool flag = false;
    while (ss >> str) {
        if (str.size() < 7 && str.size() > 2) {
            if (flag) cout << " ";
            flag = true;
            cout << str;
        }
    }
    cout << endl;

    return 0;
}