loading
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
test = input()

def testPal(x):
   return True if x == x[::-1] else False

while not testPal(test):
   found = False
   for i in range(0, len(test)):
      if testPal(test[0:i] + test[i+1:]):
         found = True
         test = test[0:i] + test[i+1:]
         break
   if not found:
      test = test[1:]

print(test)