import re while 1:print(*re.findall('\w+ \d',re.sub('(\D[a-z]*)',r'1 \1 ',input()+'1')))