while 1:r=raw_input();print max([x*(x==x[::-1])for x in[r[i/88:i%92]for i in range(8e3)]],key=len)

Note that non-ascii characters in the above source code will be escaped (such as \x9f).

download

return top