#include<iostream>
#include<string>
using namespace std;
string S; bool ok = false;
int main() {
	while (cin >> S) {
		if (S.size() >= 3 && S.size() <= 6) {
			if (ok == true) { cout << ' '; }
			cout << S;
			ok = true;
		}
	}
	cout << endl;
	return 0;
}