words = [] while True: word = input() if word == "0": break words.append(word) sentence = " ".join(words) print(sentence)