def isSeparater c
  c == ' ' || c == ',' || c == '.'
end

def solve str
  first = true
  result = ""
  out = ""
  str.chars do |c|
    if isSeparater c
      if 2 < out.size && out.size < 7
        result.concat(" ") unless first
        first = false
        result.concat(out)
      end
      out = ""
    else
      out.concat c
    end
  end
  result
end

printf "%s", solve($stdin.gets.chomp)