#Longestv palindrome is removed
s=input()
subst=""
f=0
for i in range(len(s)-1):
  subst=s[:i+1]
  if subst!=subst[::-1]:
    op=subst
    f=1
  else:
    f=0
  
if(f==1):
  print(str(op))
else:
  print(s)

bb3661d911755c3ab01d40cdf130088cfcf130d6
<mask token>

<mask token>
for i in range(len(s) - 1):
    subst = s[:i + 1]
    if subst != subst[::-1]:
        op = subst
        f = 1
    else:
        f = 0
if f == 1:
    print(str(op))
else:
    print(s)

s = input()
subst = ''
f = 0
for i in range(len(s) - 1):
    subst = s[:i + 1]
    if subst != subst[::-1]:
        op = subst
        f = 1
    else:
        f = 0
if f == 1:
    print(str(op))
else:
    print(s)

#Longestv palindrome is removed
s=input()
subst=""
f=0
for i in range(len(s)-1):
  subst=s[:i+1]
  if subst!=subst[::-1]:
    op=subst
    f=1
  else:
    f=0
  
if(f==1):
  print(str(op))
else:
  print(s)
