def f(s):h=len(s)/2;r=s[:h]+'|'+s[h:];return s and max(r*(r==r[::-1]),f(s[1:]),f(s[:-1]),key=len)
for s in ("Hello World", "abcba", "Hulluh", "abcdefggfedcba", "abcdefggfabc", "AbbA"):
print '%-14s -> %s' % (s,f(s))
ZGVmIGYocyk6aD1sZW4ocykvMjtyPXNbOmhdKyd8JytzW2g6XTtyZXR1cm4gcyBhbmQgbWF4KHIqKHI9PXJbOjotMV0pLGYoc1sxOl0pLGYoc1s6LTFdKSxrZXk9bGVuKQoKZm9yIHMgaW4gKCJIZWxsbyBXb3JsZCIsICJhYmNiYSIsICJIdWxsdWgiLCAiYWJjZGVmZ2dmZWRjYmEiLCAiYWJjZGVmZ2dmYWJjIiwgIkFiYkEiKToKCXByaW50ICclLTE0cyAtPiAlcycgJSAocyxmKHMpKQ==