import re w=raw_input() while w.strip(): print w w=re.sub("[^ ]([^ ]*)"," \\1",w)