import sys

for line in sys.stdin:
    print("".join(reversed(line.rstrip())))


reversed是可迭代对象,使用join连接。