from os import sep
import sys

while True:
    a=input()
    if a == "0":
        break
    print(a,end=" ")