#include<iostream>
#include<string>
using namespace std;
string S, T; bool ok = false;
int main() {
	while (cin >> S) {
		T = "";
		for (int i = 0; i < S.size(); i++) {
			if (S[i] == '.' || S[i] == ',') {

			}
			else {
				T += S[i];
			}
		}
		S = T;
		if (S.size() >= 3 && S.size() <= 6) {
			if (ok == true) { cout << ' '; }
			cout << S;
			ok = true;
		}
	}
	cout << endl;
	return 0;
}