Python,基本功需要扎实:

while True:
    try:
        string = str(input().strip())
        print(string[::-1])
    except:
        break