#include<stdio.h>#include<string>#include<iostream>#include<ctype.h>usingnamespace std;#define maxn 5010int pos[maxn];intmain(){int len, st, ed, k, maxL;
string s, s1;getline(cin, s);
s1 = s;
len = s.size();
st = ed = k = maxL =0;for(int i =0; i < len; i++){if(isalpha(s[i])){
pos[k]= i;if(s[i]<97) s1[k++]= s[i]+32;else s1[k++]= s[i];}}int cnt =2* k -1;int L, R;for(int center =0; center < cnt; center++){int left = center /2;int right = left + center %2;int res = left == right ?-1:1;while(left >=0&& right < k && s1[left]== s1[right]){
res +=2;if(res > maxL){
maxL = res;
L = pos[left], R = pos[right];}
left--, right++;}}
cout << s.substr(L, R - L +1);return0;}