x=require('fs').readFileSync('/dev/stdin','utf8').trim().split(/\s/);
for(str="",i=0;i<x.length;i++){if(x[i].length>=3&&x[i].length<=6)(str += x[i].replace(","," ").replace(".",""));}
console.log(str);