http://noi.openjudge.cn/ch0107/34/
"""
1.7 编程基础之字符串 34 回文子串
http://noi.openjudge.cn/ch0107/34/
"""
def find( start,end):
flag=0
h=start
t=end
while h<=t:
if s[h]!=s[t]:
flag=1
break
else:
h+=1
t-=1
if flag==0:
i=start
while i<end:
print(s[i],end='')
i+=1
print(s[end])
s=input()
lena=len(s)
k=2
while k<=lena:
i=0
while i<=lena-k:
find(i,i+k-1)
#print(i)
i+=1
k+=1