a = list(input())

for i in a[::-1]:

    print(i, end="")

print()

a = list(eval(input()))

a.reverse()

print((''.join(a)))
a = list(input())
for i in a[::-1]:
    print(i, end="")
print()

a = list(eval(input()))
a.reverse()
print(("".join(a)))

-a = list(input()) -for i in a[::-1]: -    print(i, end="") -print() +a = list(eval(input())) +a.reverse() +print(("".join(a)))