a = input()
b = a.split(" ")
b.reverse()
print(" ".join(b))

可能有点简单,但是没毛病 split(' ') 将字符串以列表的形式返回
reverse() 倒叙字符返回None,join 输出