#妙啊,迭代器的写法

lst=[]
endstr='0'
s=''
for line in iter(input,endstr):  # 每行接收的东西
    lst.append(line)
print(' '.join(lst))