lines = [line for line in iter(input, '0')]  
print(' '.join(lines))