def main(input = STDIN)
  keys = [".", ",", " "]
  str = [input.gets]
  keys.each {|key|
    str.map!{|s|s.split(key)}.flatten!
  }
  puts str.select{|word|(word.length > 2) and (7 > word.length)}.join(" ")
end
main