var input = require('fs').readFileSync('/dev/stdin', 'utf8').trim();
var words = input.split(/[ ,.]+/);

var r = words.filter(function(word) {
    return word.length > 2 && word.length < 7;
})

console.log(r.join(' '));