#include <iostream>
#include <cstring>

using namespace std;

int main(){
	char c[2000];
	int t = 0;
	while(cin >> c){
		int idx = 0;
		bool f = true;
		if(c[strlen(c)-1] == ',' || c[strlen(c)-1] == '.') c[strlen(c)-1] = 0;
		while(c[idx]){
			char d = c[idx];
			if(!(('A'<=d&&d<='Z')||('a'<=d&&d<='z'))) f=false;
			++idx;
		}
		if(f && 3 <= idx && idx <= 6){
			if(t) cout << " ";
			cout << c;
			++t;
		}
	}
}