import sys

# 读取输入
nums = input().split()

# 去掉结束标志 0
nums.pop()

# 倒序输出
print(' '.join(nums[::-1]))