semeru/Code-Code-CloneDetection-POJ104 huggingface dataset:
int f(char b[], int m)
{
     int i, j, k, l, flag;
     for (j = 2; j <= m; j++)
	 {
          for (i = 1; i <= m - 1; i++)
		  {
               flag = 1;
               for (k = 0; k < j; k++)
			   {
                    if (b[i + k] != b[i + j - k - 1])
                    {
						flag = 0;
					}
			   }
               if (flag)
			   {
                    for (l = 0; l < j; l++)
					{
                         cout << b[i + l];
					}
					cout<<endl;
			   }
		  }
	 }
     return 0;
}

int main()
{
    int m;
    char a[501];
    for (m = 1; m > 0; m++)
	{
         if (a[m-1]== '\n')
         {
			 break;
		 }
         a[m] = cin.get();
	}
    f(a, m);
    return 0;
}
int main()
{
	int n,i,j,k,t;
	int flag;
	char a[502];
	char p;
	i=1;
	while(cin.get(p)&&p!='\n')
	{
	a[i]=p;
	n=i;
	i++;
	}		//????????
	for(i=2;i<=n;i++)	//????????????2?n
		for(j=1;j<=n+1-i;j++)	//????????????i???j???j+i-1??
		{	for(k=0;k<=i-1;k++)	
			{
			if(a[j+k]==a[j+i-1-k])	//?????i????????
				flag=1;
			else{flag=0;break;}
			}
		if(flag==1)		
		{for(t=j;t<=j+i-2;t++)
			cout<<a[t];		//???i-1??
		cout<<a[j+i-1]<<endl;} //???i?????
		}
	return 0;
}
/*
 * huiwenzilie.cpp
 *
 *  Created on: 2010-12-19
 *      Author: lz
 */

int main()
{
	char c[600];
	cin>>c;
	int p;
	int q;
	int i;
	int j;
	int zilen;
	int len=strlen(c);
	for(zilen=2;zilen<=len;zilen++)//???????
		for(i=0;i<=len-zilen;i++)//???????????
		{
			p=i;//????????
			q=i+zilen-1;//????????
			while(p<q)//???????
			{
				if(c[p]==c[q])
				{
					p++;
					q--;
				}
				else
					break;
			}
			if(p>=q)
			{
				for(j=i;j<i+zilen;j++)
					cout<<c[j];
				cout<<endl;
			}
		}
	return 0;
}
void checkstr (char str[] , int) ;

int main ()
{
	char str[500] ;
	int  i = 2 , len ;
	cin >> str ;
	len = strlen(str) ;
	for (i = 2 ; i <= len ; i ++)
	{
	    checkstr(str , i) ;
	}
	return 0 ;
}
void checkstr (char str[] , int i)
{
	int b , e , b1 , b2 , e2 , count = 0 , len ;
	len = strlen(str) ;
	for (b = 0 ; b <= len - i ; b ++)
	{
		b2 = b ;
		e2 = b + i - 1 ;
		for ( b1 = b , e = b + i - 1; b1 < e ; b1 ++ , e --)  
		{
			if (str[b1] == str[e])
				count ++ ;
		}
		if (count == i / 2)
		{
			for (b1 = b2 ; b1 <= e2 - 1; b1 ++)
			{
				cout << str[b1] ;
			}
			cout << str[e2] << endl ;
		}
		count = 0 ;
	}
}
main()
{int i,j,k,l,m=0,s=0;
	char c[500];
	scanf("%s",c);
k=strlen(c);
for(i=2;i<=k;i++)
{
	for(j=0;j<=k-i;j++)
{
for(l=0;l<=i/2-1;l++)
if(c[l+j]==c[j+i-l-1])m++;

if(m==i/2)
{for(l=0;l<=i-1;l++)
printf("%c",c[j+l]);
s++;	}
m=0;
if(s!=0)
printf("\n");
s=0;}

}

}
/*
???????
????? 
???2011.11.11
*/
int len; //??????
void ishui(char a[]); //?????????????
int main() //???
{
	char a[500]; 
	memset(a, ' ', sizeof(a));
	int i = 0;
	while((a[i] = cin.get()) != '\n') //?????
	{
		i++;
	}
	len = i; //????????
	ishui(a); //???????????
	return 0;
} //?????

void ishui(char a[]) //??????
{
	int i, j, k, l, flag;
	for(i = 2 ; i <= len - 1 ; i++) //????????????????
	{
		for(j = 0 ; j < len ; j++) //?????????
		{
			flag = 1; //????????1
			for(k = 0 ; k < i ; k++) //???????
			{
				if(a[j + k] != a[j + i - (k + 1)])
				{
					flag = 0; //???????
					break;
				}
			}
			if(flag == 1) //?????????
			{
				for(l = 0 ; l < k ; l++)
				{
					cout << a[j + l];
				}
				cout << endl;
			}
		}
	}
			return;
}
int main()
{
	char a[500],temp[500],temp2[500];
	int i,k,j,b;
	gets(a);
	b=strlen(a);
	for(i=2;i<=b;i++)
	{
		for(j=0;j<b-i+1;j++)
		{
			strncpy(temp,&a[j],i);
			for(k=0;k<i;k++)
			{
				
				temp2[k]=temp[i-k-1];
			}
			temp[i]='\0';
			temp2[i]='\0';
			if(strcmp(temp,temp2)==0) printf("%s\n",temp);
		}
	}
	
	
}
char s[555];

int f(int i,int j)
{
	int k;
	if (j==2)
	{
		if (s[i]==s[i+1])
			return 1;
		else return 0;
	}
	else if (j==3)
	{
		if (s[i]==s[i+2])
			return 1;
		else return 0;
	}
	else 
	{
		for (k=0;k<=j/2-1;k++)
			if (s[i+k]!=s[i+j-1-k])
				break;
		if (k==j/2)
			return 1;
		else return 0;
	}
}

int main()
{
	int i,j,k,len;
	
	gets(s);
	len=strlen(s);
	for (i=len;i>0;i--)
		s[i]=s[i-1];
	s[0]=0;
	
	for (j=2;j<=len;j++)
		for (i=1;i<=len+1-j;i++)
			if (f(i,j)==1)
			{
				for (k=i;k<i+j-1;k++)
					printf("%c",s[k]);
				printf("%c\n",s[i+j-1]);
			}
			
			return 0;
}
int i, b = 2;
char a[500] = {0};
int shuchu(char a[],int i)
{
	int s, j, k, l;
	for (j = 0; j < i; j++)
		if (a[j]==a[i])
		{
			if (i - j + 1 != b)
			continue;
			s = 1;
			for (k = 1; k < (i - j + 1) / 2; k++)
			{
				if ( a[j+k] != a[i-k] )
				{
					s = 0;
					break;
				}
			}
			if (s == 0)
				continue;
			if (s == 1)
			{
				for (l = j; l <= i; l++)
					cout << a[l];
				cout <<endl;
			}
		}
		return 0;
}

int main()
{
	cin >> a;
	for (b = 2; b <= 99; b++)
	for (i = 1; a[i] != 0; i++)
	{
		shuchu(a,i);
	}
	return 0;
}
int main()
{
	int i,j,k,t;
	char str[500]={"1"};
	gets(str);
	for(k=1;k<strlen(str)-1;k++)
	    for(i=0;i<strlen(str)-k;i++){
			t=0;
			for(j=0;j<(k+1)/2;j++){
				if(str[i+j]!=str[i+k-j]){t=1;break;}
			}
			if(t==0){
				for(j=i;j<=i+k;j++)
					printf("%c",str[j]);
				printf("\n");
			}
		}
	return 0;
}
int main()
{
	char str[520];
	int len, i, j, k, num;
    cin >> str;
	len = strlen(str);
	for (i = 2; i <= len; i++)
	{
		for (j = 0; j <= len - i; j++)
		{
			num = 0;
			for (k = 0; k < i; k++)
			{
				if (str[j + k] == str[j + i - k - 1])
					num++;
			}
			if (num == i)
			{
				for (k = 0; k < i; k++)
					cout << str[j + k];
				cout << endl;
			}
		}
	}
	return 0;
}
/*
 * ????.cpp
 *
 *  Created on: 2010-12-20
 *      Author: ???
 */
int main()
{
	char a[501],b[501],c[501];              //a???????b??????c??????
	int i,len,j,k;                          //len???
	cin>>a;                                 //??
	len=strlen(a);
	for (k=2;k<=len;k++)                    //????k?????
	{
	    for (i=0;i<501;i++)                 //???
	    {
	    	b[i]=c[i]='\0';
	    }
		for (i=0;i<len;i++)
	    {
		    if (i+k<=len)                      //????????
		    {
	    	   for (j=i;j<i+k;j++)             //??k???????
			       b[j-i]=a[j];
		       for (j=0;j<k;j++)               //??
		       {
		 	       c[j]=b[k-j-1];
		       }
		       if (strcmp(b,c)==0)             //?????????
			       cout<<b<<endl;
		    }
		    else break;
	    }
	}
	return 0;
}
int main()
{
    char a[500];
    cin>>a;
    int L;                                       //????????L
    for(int i=0;i<500;i++)
    {
        if(a[i]==0)                              //??????????????????????????? 
        {
            L=i;
            break;
        }
    }
    for(int i=1;i<L-1;i++)                       //??????i???????????????1?????2??L-1?????L? 
        for(int j=0;j<L-i;j++)                   //??????j??????????? 
        {                                        //??????????????????????????????? 
            int flag=1;                          //???????flag????1???? 
            for(int k=0;k<1+i/2;k++)             //??????k???????????????????? 
            {
                if(a[j+k]!=a[j+i-k])flag=0;      //???????????????flag???0 
            }
            if(flag==1)
            {
                for(int k=0;k<=i;k++)cout<<a[j+k];
                cout<<endl;
            }
        }
    return 0;
}
//**********************************
//* ????????               *
//* ??????                   *
//* ???2010-11-24               *
//* ?????????             *
//**********************************
void judge(char n[],int i,int len);
int main()
{
	char n[500],str;
	int i = 0,len = 2;
	cin >> n;
	for(len = 2; len <= strlen(n); len++)
		for(i = 0; i <= strlen(n) - len; i++)
			judge(n,i,len);
	return 0;
}
void judge(char n[],int i,int len)
{
	int j = 0;
	for(j = 0; j < len; j++)
		if(n[i + j] != n[i + len - j - 1])
			return;
	for(j = 0; j < len; j++)
		cout << n[i + j];
	cout << '\n';
	return;
}
int main()
{
	char str[500];
	int i, j, k,len,l;
	cin.getline(str,500);

	len=strlen(str);

	for (i=2;i<=len;i++)
	{
		for (k=0;k<=len-i;k++)
		{
			for (j=k,l=i+k-1; j<i+k; j++,l--)
			{
				if (str[j] != str[l])
					break;
			}
			if (j==i+k)
			{
				for (j=k;j<i+k;j++)
					cout << str[j];
				cout << endl;
			}
		}
	}

	return 0;
}
int main()
{
	char str[500];
	int lenth,i,l,j,counter;
	gets(str);
	lenth=strlen(str);
	for(i=0;i<=lenth-2;i++)
	{
		if(str[i]==str[i+1])
			printf("%c%c\n",str[i],str[i+1]);
	}
	for(l=3;l<=lenth;l++)
	{
		for(i=0;i<=lenth-l;i++)
		{
			counter=0;
			for(j=0;j<=l-1;j++)
			{
				if(str[i+j]==str[i+l-j-1])
					counter+=1;
			}
			if(counter==l)
			{
				for(j=0;j<=l-2;j++)
				{
					printf("%c",str[i+j]);
				}
				printf("%c\n",str[i+l-1]);
			}
		}
	}
	return 0;
}
int main()
{
	int s,i,j,n,r,ok;
	char a[505];
	gets(a);
	n=strlen(a);
	for (r=2;r<=n;r++)
		for (i=0;i<=n-r;i++)
		{
			ok=1;
			j=i+r-1;
		    for (s=i;s<=i+(j-i)/2;s++)
				if (a[s]!=a[j+i-s])
				{ok=0;break;}
			if (ok)
			{
				for (s=i;s<=j;s++)
					printf("%c",a[s]);
                printf("\n");
            }
		}
    
	return 0;
}
void sub(char common[],char minlen[],int n,int now)
{
	char *a,*b;
	for(a=common,b=minlen+now;a<common+n;a++,b++)
	{
		*a=*b;
	}
	*a='\0';
}
int compare(char a[],int n)
{
	int i,flag=1;
	for(i=0;i<strlen(a)/2;i++)
	{
		if(a[i]!=a[strlen(a)-i-1])
		{
			flag=0;
			break;
		}
	}
	return flag;
}
int main()
{
	void sub(char common[],char minlen[],int n,int now);
	int compare(char a[],int n);
	char str[500];
	scanf("%s",str);
	int i,j;
	if(strlen(str)>1)
	{
		for(i=2;i<=strlen(str);i++)
		{
			for(j=0;j<strlen(str)-i+1;j++)
			{
				char substr[500];
				sub(substr,str,i,j);
				if(compare(substr,i)==1)
				{
					printf("%s\n",substr);
				}	
			}
		}
	}
	return 0;
}
int main()
{
	char c[505];
	cin >> c;
	int i, j, len;
	len = strlen(c);
	for (i = 2; i < len; i++)
	{
		for (j = 0; j <= len - i; j++)
		{
			int k, l, flag = 1;
			for (k = j, l = j + i - 1; k < j + i - 1, l > j; k++, l--)
			{
				if (c[k] != c[l])
				{
					flag = 0;
					break;
				}
			}
			if (flag == 1)
			{
				for (int a = j; a < j + i; a++)
					cout << c[a];
				cout << endl;
			}
		}
	}
	return 0;
}
/*
 * 37.cpp
 *
 *  Created on: 2013-12-22
 *      Author: Administrator
 */
int main()
{
	int i,j,s,ii,ss,kk;
	char a[1000];
	cin>>a;
	s=strlen(a);
	for(i=2;i<=s;i++)
	{
		ss=0;
		for(j=0;j+i<=s;j++)
		{
			for(ii=0;ii<=i-1;ii++)
			 if(a[j+ii]==a[j+i-1-ii])
            	 ss=1;
             else
             {
            	 ss=0; break;
             }
			if(ss==1)
				for(kk=0;kk<i;kk++)
					cout<<a[j+kk];
			if(ss==1)
				cout<<endl;
		}
	}
	return 0;
}
/*
 * ?????????????????
???????????????????????????
??? abba   cccdeedccc???????

????????????????2
????
????????????????500??
???
abcddcbaab
????
??????????????????????
?????????????????????????????
????abcddcbaab
???
dd
aa
cddc
baab
bcddcb
abcddcba
????
123321125775165561
????
33

11

77

55

2332

2112

5775

6556

123321

165561

??
(??????????)
 */
int main()
{
	static char c[501],c1[501],c2[501];
	int n,i,j,p,q,k,s;
	gets(c);
	for(i=0;;i++)
	if(c[i]==0) 
	{  n=i; break;}
	for(i=2;i<=n;i++)
	for(j=0;j<=n-i;j++)
	{
		for(p=0;p<i;p++)
		{
			c1[p]=c[j+p];
			c2[p]=c[j+i-p-1];
			}
		for(;p<501;p++)
		{
			c1[p]=0;
			c2[p]=0;
			}
		s=0;
		for(k=0;s==0&&k<501;k++)
		s=c1[k]-c2[k];
		if(s==0)
		printf("%s\n",c1);
		}
}
int main()
{
	char a[500];
	int i, j, l, k = 0;
	cin.getline(a, 500);
	l = strlen(a);
	for (i = 2; i <= l; i++)
		for (j = 0; j <= l - i; j++)
		{	
			k = j;
			while (a[k] == a[2*j+i-1-k] && k < 2*j+i-1-k)
				k++;
			if (k >= 2*j+i-1-k)
			{
				for (k = j; k < j+i; k++)
					cout << a[k];
				cout << endl;
			}
		}
	return 0;
}
int main()
{
	int i,j,k,d,n,t;
	char a[600];
	scanf("%s",a);
	n=strlen(a);
	for (d=1;d<=n;d++)
	{
		for (i=0;i+d<=n-1;i++)
		{
			if (a[i]==a[i+d])
			{
                t=0;
				if (d%2==1)
				{
					for(k=0;k<=d/2;k++)
					{
						if (a[i+k]==a[i+d-k])
						{
							t=t+1;
						}
					}
					if (t==(d+1)/2)
					{
						for (k=i;k<=i+d;k++)
						{
							printf("%c",a[k]);
						}
						printf("\n");
					}
				}
				else
				{
					for(k=0;k<=d/2-1;k++)
					{
						if (a[i+k]==a[i+d-k])
						{
							t=t+1;
						}
					}
					if (t==d/2)
					{
						for (k=i;k<=i+d;k++)
						{
							printf("%c",a[k]);
						}
						printf("\n");
					}
				}
			}
			else
				continue;
		}
	}
	return 0;
}
int hw(char w[]){
int l=strlen(w);
for(int i=l>>1-1;i>=0;i--)
if(w[i]!=w[l-i-1])return 0;
return 1;
}
int main(){
char w[10000],p[10000];
cin>>w;
int l=strlen(w);
for(int j=2;j<l;j++)
for(int i=0;i<l-j+1;i++){
memcpy(&p,&w[i],j);
p[j]=0;
if(hw(p))cout<<p<<endl;
}
return 0;
}
int main()
{
	int i, j, d, g, k, l;
	char a[501];
	cin >> a;
	d = strlen(a);
	for(i = 2; i <= d; i ++)
	{
		for(j = 0; j + i <= d; j ++)
		{
			g = 0;
			for(k = j, l = j + i - 1; k < l; k ++, l --)
			{
				if(a[k] != a[l])
				{
					g = 1;
					break;
				}
			}
			if(g == 0)
			{
				for(k = j; k <= j + i - 1; k ++)
				{
					cout << a[k];
				}
				cout << endl;
			}
		}
	}
	return 0;
}
int  main()
{
	char a[500];
	int len,i,j,k,p,flag,m;
	gets(a);
	len=strlen(a);
	for(i=2;i<=len;i=i+2)
	{
		for(j=0;j<len;j++)
		{
			flag=0;
			for(k=0;k<i/2;k++)
			{
				if(a[j+k]==a[j+i-1-k])
					flag=1;
				else {
					flag=0;break;
				}
			}
			if(flag)
			{
				for(m=j;m<j+i;m++)
					printf("%c",a[m]);
				printf("\n");
			}
		}
	}
return 0;
}
//******************************
//????1000012825           *
//??????                 *
//???11.28                  *
//???????               *
//******************************
int main ()
{
	char str[500], h[500];
	int i, len, j, k, l = 0, p, q, flag = 0;
	cin.getline( str, 500 );
	len = strlen (str);          //??????????
	for ( i = 2; i <= len ; i++ )
	{
		for ( j = 0; j <= len - i ; j++ ) //????????2?len,????????
		{
			l = 0;
			for ( k = j; k <= j + i - 1; k++ )
			{
				h[l++] = str[k];       //??????????????
			}
			for ( p = 0; p <= i / 2 - 1; p++ ) //?????????????????
			{
				if ( h[p] != h[ i - 1 - p] )
					break;
			}
			if ( p == i /2 )
			{
				for ( q = 0; q <= i - 2; q++ )
					cout << h[q] ;
				cout << h[i - 1] << endl;//?????
			}
		}
	}
	return 0;
}
/*
 * huiwen.cpp
 *
 *  Created on: 2011-12-18
 *      Author: admin
 */
int main(){
	int i,begin,begin1,end1,flag,len,length;
	char a[501];
	cin>>a;
	length=strlen(a);
	for (len=2;len<=length;len++){//???????
		for (begin=0;begin<=length-len;begin++){//??????
			begin1=begin;end1=begin+len-1;
			flag=1;
			while(begin1<end1){//?????????????
				if (a[begin1]!=a[end1]){flag=0;break;}
				begin1++;end1--;
			}
			if (flag){
				for(i=begin;i<=begin+len-1;i++){//??????
					cout<<a[i];
				}
				cout<<endl;
			}
		}
	}
	return 0;
}
int main()
{
    char s[500];
    char c;
    char e;
    int d;
    int i,j,k,p;
    gets(s);
    int m=strlen(s);
    for(k=2;k<=m;k++)
    {
                    for(i=0;i<=(m-k);i++)
                    {
                                               for(j=i;j<(i+(k)/2);j++)
                                               {
                                                                   d=0;
                                                                   if(s[j]!=s[k+i-1-(j-i)])
                                                                   {
                                                                                     d=1;
                                                                                     break;
                                                                   }
                                               }
                                               if(d==0)
                                               {
                                                       printf("\n");
                                                       for(p=i;p<i+k;p++)
                                                       {
                                                                         printf("%c",s[p]);
                                                       }
                                               }
                    }
    }
     return 0;
}
/*
 * 90.cpp
 *
 *  Created on: 2011-12-25
 *  ???????
 */

int main()
{
	char x[501];
	cin.getline(x,501);
	int n,i,j,k,p;
	int begin,end;
	p=strlen(x);
	for(n=2;n<=500;n++)
	{
		for(i=0,j=n-1;j<p;i++,j++)
		{
			begin=i;
			end=j;
			while(begin<end)
			{
				if(x[begin]!=x[end]) break;
				else
				{
					begin=begin+1;
				    end=end-1;
				}
			}
			if(begin>end)
			{
				for(k=i;k<=j;k++)
				{
					cout<<x[k];
				}
				cout<<endl;
			}
		}
	}
	return 0;
}
//**********?????????*****************
//**********???????*********************
//**********?????2012?11?9?************
//**********???1200062701******************


int main()
{
	int totallength = 0, flag = 0;                //??????????
	char a[500];
	cin >> a;                                     //???????
	for(int b = 0; b < 500; b++)
	{
		if(a[b] == 0) break;                      //???????
		else
		{
			totallength++;
		}
	}											  //????????
	for(int length = 2; length <= 500; length ++)
	{
		for(int j = 0; j <= totallength - length + 1; j++)  
		{                                         //????????????
			for(int k = 0; k < length / 2; k++)
			{
				if(a[j + k] == a[j + length - 1 - k])
				{
					flag++;                       //???????
				}
			}
			if(flag == length / 2)                //?????????
			{
				for(int l = j; l <= j + length - 1; l++)
				{
					cout << a[l];
					flag = 0;                     //???????
				}
				cout << endl;                     //???????
			}                                     //??????
			else
			{
				flag = 0;                         //?????????
			}
		}
	}
	return 0;
}
int main()
{
	char a[500];
	int i,j,l,k,m=0;
	gets(a);
	for(i=2;i<=strlen(a);i++)
	{
		for(j=0;j<=(strlen(a)-i);j++)
		{
			for(l=j,k=j+i-1;l<=k;l++,k--)
			{
				if(a[l]==a[k])
				m=1;
				else
				{
					m=0;
					break;
				}
			}
			if(m==1)
			{
				for(k=j;k<j+i;k++)
				printf("%c",a[k]);
				printf("\n");
			}
		}
	}
	
	return 0;
}
char c[500];
int f(int e0,int s0);
int main(){
	int i,j,k,e,s;

	scanf("%s",c); 
	int len;
	len=strlen(c);
	for(i=0;i<len;i++){
		for(j=0;j<len;j++){
			if(j-i>=0&&i+j+1<=len){
				if(c[j-i]==c[i+j+1]){
					s=j-i;
					e=i+j+1;
					if(f(e,s)){
					for(k=s;k<=e;k++)
						printf("%c",c[k]);
					printf("\n");
					}
				}
			}
		}
	}
	return 0;
}
int f(int e0,int s0){
	int i0,sum=0;

	for(i0=s0;i0<=e0;i0++){
		if(c[i0]!=c[s0+e0-i0])
			sum++;
	}
	if(sum==0)
		return 1;
	else return 0;
}
/*
?? 
????????????????? 
??????????????????????????? 
??? abba   cccdeedccc??????? 

????????????????2
 
???? 
????????????????500?? 
??? 
abcddcbaab
 
???? 
?????????????????????? 
????????????????????????????? 
????abcddcbaab 
??? 
dd 
aa 
cddc 
baab 
bcddcb 
abcddcba
 
???? 
123321125775165561
 
???? 
33
11
77
55
2332
2112
5775
6556
123321
165561
*/


int main()
{
	char str[501]; //?????????
	int checklen,strlen,i,j,temp;  //checklen??????????
	cin>>str;

	for (i=0;str[i]!='\0';i++)
	{
		strlen=i;
	}  //strlen?????????1

	for (checklen=2;checklen<=strlen+1;checklen++)   //??????????2????
	{
        for (i=0;i<=strlen-checklen+1;i++)  //?????????????
		{
			for (j=0;;j++)   
			{
                if ((str[i+j]==str[i+checklen-1-j])&&((i+j)<(i+checklen-1-j)))     continue;
				else if (str[i+j]!=str[i+checklen-1-j])     break;
				else if ((str[i+j]==str[i+checklen-1-j])&&((i+j)>=(i+checklen-1-j)))
				{
			        temp=checklen;
			        for (temp=0;temp<=checklen-1;temp++)
			        {
				        cout<<str[i+temp];
			        }
			        cout<<endl;
					break;
				}    //????????????????????
			}
		}
	}
	return 0;
}
void huiwen(int k, char a[], int b[])
{
	int i;
	int j = 0;
	for (i = 0; i < (int)strlen(a) + 1 - k; i++)
	{
		if ((a[i] == a[i+k-1])&&(b[i+1] == 0))
		{
			for (j = i; j<= i + k - 1; j++)
			{
				cout << a[j];
			}
			b[i] = 0;
			cout << endl;
		}
		else
		{
			b[i] = 1;
		}
	}
}
int main()
{
	char a[501];
	int b[500] = {0};
	cin >> a;
	int i, j = 0, k = 0;
	for (k = 2; k <= (int)strlen(a); k += 2)
	{
		huiwen(k, a, b);
	}
	return 0;
}
void f1(char a[],int l)
{
	char b[501];
	int j;
	for (j=0;j<l;j++)
	{
		b[l-j-1]=a[j];
	}
	b[l]='\0';
	if (strcmp(a,b)==0)
		puts(a);
}
void f2(char s[],int l,int L)
{
	int m,n,i;
	char a[501];
	for(m=0;m<L-l+2;m++)
	{
		i=0;
		for(n=m;n<m+l;n++)
		{
			a[i]=s[n];
			i=i+1;
		}
		a[i]='\0';
		f1(a,l);
	}
}
void f3(char s[], int L)
{
	int l;
	for (l=2;l<L+1;l++)
		f2(s,l,L);
}
void main()
{
	char s[501];
	gets(s);
	int L;
	L=strlen(s);
	f3(s,L);
}
int main()
{
	char a[600];
	int flag;
	cin >> a;
	int num = strlen(a);
	for(int i = 2; i <= num;i++) //????
	{
		for(int j = 0;j <= num-i+1;j++) //???
		{
			flag = 0;
			for(int k = 0; k < i/2;k++) //??????
			{
				if(a[j+k] != a[j+i-k-1])
				{
					flag = 1;
					break;
				}
			}
		    if(flag == 0)
			{
				for(int l = j; l<=j+i-1;l++)
					cout << a[l];
				cout << "\n";
			}
		}
	}
	return 0;
}
int jichuan(int x , char s[] , int b[] , int l)
{
    int p , q , t , i , j ; 
    for (p = x , q = l - x , t = 0 , i = p ; i <= q ; i ++ )
    {
        if ((b[i]) && (s[i - x] == s[i + x]))
        {
                   for (j = i - x ; j <= i + x ; j ++ )
                       cout << s[j] ; 
                   cout << endl ; 
                   t ++ ; 
        }
        else
                   b[i] = 0 ; 
    }
    return t ; 
}

int ouchuan(int x , char s[] , int a[] , int l)
{
    int p , q , t , i , j ; 
    for (p = x - 1, q = l - x , t = 0 , i = p ; i <= q ; i ++ )
    {
        if ((a[i]) && (s[i - x + 1] == s[i + x]))
        {
                   for (j = i - x + 1; j <= i + x ; j ++ )
                       cout << s[j] ; 
                   cout << endl ; 
                   t ++ ; 
        }
        else
                   a[i] = 0 ; 
    }
    return t ;
}

int main()
{
    int a[501] , b[501] , l , i , m0 , m1 , max ; 
    char s[501] ; 
    cin >> s ; 
    l = strlen(s) - 1 ; 
    for (i = 0 ; i <= l ; i ++ )
    {
        a[i] = 1 ; 
        b[i] = 1 ; 
    }
    for (m0 = 1 , m1 = 1 , max = (l + 1) / 2 , i = 1 ; i <= max ; i ++ )
    {
        if (m0 != 0)
               m0 = ouchuan(i , s , a , l) ; 
        if (m1 != 0)
               m1 = jichuan(i , s , b , l) ; 
        if ((m1 == 0) && (m0 == 0))
           break ; 
    }
    return 0 ; 
}
int min(int x,int y);
int main()
{
char s[501]={0};
int d[501][501]={0},e[501]={0};
gets(s);
int l,i,j,t;
l=strlen(s);
for (i=1;i<(l-1);i=i+1) //????
{
for (j=1;j<=min(i,l-i-1);j=j+1)
{
if (s[i-j]==s[i+j])
{
d[2*j+1][e[2*j+1]]=i;
e[2*j+1]=e[2*j+1]+1;
}
else
break;
}
}
for (i=0;i<(l-1);i=i+1) //???????????
{
for (j=0;j<=min(i,l-i-1);j=j+1)
{
if (s[i-j]==s[i+1+j])
{
d[2*j+2][e[2*j+2]]=i;
e[2*j+2]=e[2*j+2]+1;
}
else
break;
}
}
for(i=2;i<=l;i=i+1)
{
for (j=0;j<e[i];j=j+1)
{
if (i % 2==0)
{
for(t=(d[i][j]-i/2+1);t<=(d[i][j]+i/2); t=t+1)
printf("%c",s[t]);
printf("\n");
}
else
{
for(t=(d[i][j]-i/2);t<=(d[i][j]+i/2);t=t+1)
printf("%c",s[t]);
printf("\n");
}
}
}
return 0;
}
int min(int x,int y)
{
if (x>y) return(y);
else return(x);
}
int main()
{int b,i,r,x,y,z,n;
char a[600];
scanf("%s",a);
n=strlen(a);
for(i=2;i<=n;i++)
{for(r=0;r<=n-i;r++)
{z=0;
for(y=0;y<=i/2;y++)
{if(a[r+y]!=a[r+i-1-y]){z=1;break;}

}
if(z==0)
for(b=r;b<=r+i-1;b++)
printf("%c",a[b]);
if(b==r+i-1)
{printf("\n");b=0;}
}
}
}
int print(char str[],int i,int j){
	int t,I=i,J=j;
	while(str[i]==str[j]&&j>=i){
		i++;
		j--;
	};
	if(j<i)
	{	for(t=I;t<=J;t++) printf("%c",str[t]);
		printf("\n");
	}
	return 0;
}
void main(){
	char str[501];
	int i,j,len;
	gets(str);
	len=strlen(str);
	for(i=1;i<len;i++)
		for(j=i;j<len;j++)
			print(str,j-i,j);
}
int main()
{
	char s[1000];
	char s1[1000],s2[1000];
	int i,j,k=0,l=0,m,len,flag=0;
	gets(s);
	len=strlen(s);
	j=1;
	while(j<=len-1)
	{
		for(i=k;i<=len-j-1;i++)
		{
			for(m=0;m<=j;m++)
			{
				s1[m]=s[i+m];
				s2[m]=s[i+j-m];
			}
			s1[m]='\0';
			s2[m]='\0';
			if(strcmp(s1,s2)==0)printf("%s\n",s1);
		}
		k++;
		if(k=len-j)
		{
			k=0;j++;
		}
	}
	return 0;
}
char ch[600],length;
void search(int x,int y,int z)
{
	int i;
	for(i=0;i<z;i++)
		if(ch[x-i]!=ch[y+i])return;
	for(i=x-z+1;i<=y+z-1;i++)
		cout<<ch[i];
	cout<<endl;
}
int main()
{
	int i,j,k;
	cin>>ch;
	length=strlen(ch);
	for(i=2;i<=length;i++)
	{
		for(j=(i-1)/2;j<=length-i/2-1;j++)
		{
			if(i%2==0)search(j,j+1,i/2);
			else search(j-1,j+1,i/2);
		}
	}
	return 0;
}