Python 代码实现

while True:
    try:
        string = list(input().split())
        print(' '.join(string[::-1]))
    except:
        break