s = eval(input())

if len(s) == 2:

    print(s)

else:

    print((s[::-1]))
s = list(eval(input()))

if len(s) == 2:

    print(("".join(s)))

else:

    print(("".join(s[::-1])))
s = eval(input())
if len(s) == 2:
    print(s)
else:
    print((s[::-1]))

s = list(eval(input()))
if len(s) == 2:
    print(("".join(s)))
else:
    print(("".join(s[::-1])))

-s = eval(input()) +s = list(eval(input())) -    print(s) +    print(("".join(s))) -    print((s[::-1])) +    print(("".join(s[::-1])))