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

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