while True:
    try:
        s = input().strip().split(' ')[::-1]
        for x in s:
            x = x[::-1]
            print(x, end=' ')
    except:
        break