s = raw_input()
i = 0
while i < len(s)/2 and s[i] == s[len(s)-i-1]:
   i = i + 1
if i < len(s)/2:
   print
else:
   print s

55c354b9767f23c99eead9182092ba7f69d6af3f
s = raw_input()
i = 0
while i < len(s)/2 and s[i] == s[len(s)-i-1]:
   i = i + 1
if i < len(s)/2:
   print
else:
   print s
