# Volume0 - 0084
# Search Engine
# http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0084

line = $stdin.gets.chomp
words = line.split( /\.+|\s+|,+/)
words.delete_if{ |w| w.size <= 2 || w.size >= 7 }
words.each_with_index{ |w,i|
	print " " if i > 0
	print w
}
puts
