s=eval(input())

if(len(s)<3):print(s)

else:print((s[::-1]))
s=eval(input());print((s[::-1]*(len(s)-2)or s))
s = eval(input())
if len(s) < 3:
    print(s)
else:
    print((s[::-1]))

s = eval(input())
print((s[::-1] * (len(s) - 2) or s))

-if len(s) < 3: -    print(s) -else: -    print((s[::-1])) +print((s[::-1] * (len(s) - 2) or s))