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

int main() {
    string str;
    getline(cin, str);
    bool insertSpace = false;
    while (str.find_first_of(" ,.") != string::npos) {
        string::size_type pos = str.find_first_of(" ,.");
        if (3 <= pos && pos <= 6) {
            if (insertSpace) {
                cout << " ";
            } else {
                insertSpace = true;
            }
            cout << str.substr(0, pos);
        }
        str.erase(0, pos + 1);
    }
    cout << str << endl;
}