#include <bits/stdc++.h>
using namespace std;
string input;

vector<string> split(string& str, char delim) {
    stringstream ss(str);
    vector<string> res;
    string tmp;
    while(getline(ss, tmp, delim)) res.push_back(tmp);
    return(res);
}

void solve() {
    //カンマで統一
    for(int r = 0; r < input.length(); r++)if(input[r] == ' ' || input[r] == '.')input[r] = ',';
    vector<string> ans = split(input, ',');
    for(int r = 0; r < ans.size(); r++) {
        if(ans[r].size() >= 3 && ans[r].size() <= 6) {
            cout << ans[r];
            if(r == ans.size() - 1) putchar('\n');
            else putchar(' ');
        }
    }
}

int main(void) {
    getline(cin, input);
    solve();
    return(0);
}