#include<iostream>
int main(){
std::string l[1000];int c=0,k;while(std::cin>>l[c]){k=l[c].length();if((l[c].find(","))+(l[c].find("."))!=-2)l[c].replace(k-1,1,""),k-=1;if((k>2)&&(k<7))c++;}for(k=0;k<c;k++){std::cout<<l[k];if(k!=c-1) std::cout<<" ";}std::cout<<"\n";}