semeru/Code-Code-CloneDetection-POJ104 huggingface dataset:
/*
 * ????first.cpp
 * ???00948343_??
 * ?????2012/9/16
 * ?????1???100?????????
 */


int main()
{
	char a[500], b[30][500], temp[500];
	cin >> a;
	int length = strlen (a), i, j, k, count=0;
	for (i=0;i<length;i++){
		for (j=i+1;j<length;j=j+2){
			for (k=0;k<(j-i+1)/2;k++){
				if (a[i+k]!=a[j-k])
					break;
			}
			if (k==(j-i+1)/2){
				for (k=i;k<j+1;k++){
					b[count][k-i]=a[k];
				}
				b[count][j+1-i]='\0';
				count++;
			}
		}
	}
	for (i=0;i<count-1;i++){
		for (j=0;j<count-1-i;j++){
			if (strlen(b[j])>strlen(b[j+1])){
				strcpy(temp,b[j]);
				strcpy(b[j],b[j+1]);
				strcpy(b[j+1],temp);
			}
		}
	}
	for (i=0;i<count;i++){
		cout << b[i] << endl;
	}
	return 0;
}
char substr(char s[], int start, int end)
{
     while ((end>start)&&(s[start]==s[end]))
     { 
           start++; end--;
     }
     if(end>start) return 0; 
     else return 1; 
}

void osubstr(char s[], int start, int end)
{
     while(start<=end) putchar(s[start++]);
     putchar('\n');
}
int main ()
{
    char s[500];
    int m,n,len,width; 
    gets(s);
    len=strlen(s);
    for(width=1; width<len; ++width)
    {
          for(m=0; m<=len-width;++m)
          {
                    if(substr(s,m,m+width)) osubstr(s,m,m+width);
          }
    }
    getchar();
    getchar();
    getchar();
}
int main()
{

    int i,j,k,m,n;
	char st[500];
	scanf("%s",st);
	for(i=2;i<=500;i++)
	{
	    for(j=0;j<500-i+1;j++)
		{
			if(st[j]=='\0')
				break;
			m=j+i-1;
			for(k=j;k<m;k++)
			{
				if(st[k]!=st[m])
                  break;
				else
			   m=m-1;
			}
         if(k>=m)
		  {
			  for(n=j;n<j+i;n++)
			  {
				  printf("%c",st[n]);
				if(n==j+i-1)
					printf("\n");
			  }
		  }
		}
		
	}
}
void pdjsc(char c[10000])
{
	int i,j,k,l,p=0;
	char tp,a,b;
	l=strlen(c)-1;
	for(i=0;i<=l;i++)
	{if (c[i]==c[l-i]) continue;
	 else 
		{p=1;
		 break;
		}
	}
	if (p==0) printf("%s\n",c);
}
int main()
{
	int i,j,k,l,p=0;
	char tp,a,b;
	char c[10000]={' '};
	char s[10000]={' '};
    scanf("%s",s);
	l=strlen(s)-1;
	for(i=1;i<=l;i++)//i?????????-1?
		for (j=0;j<=l-i;j++)//j??????
		{for (k=0;k<=i;k++) c[k]=s[k+j];
			pdjsc(c);
		}
	return 7;
}
int main()
{
	char a[55]={'\0'};
	int i=0,j=0,count=0,k1=0,k2=0,l=0,num=0,m=0;
	char c=getchar();
	while('\n'!=c)
	{
		a[i]=c;
		i++;
		c=getchar();
	}
	count=i;//???????????????
	for(i=2;i<=count;i++)
	{
		for(j=0;j<=count-i;j++)
		{
			num=0;
			char b[55]={'\0'},d[55]={'\0'};
			for(k1=j;k1<i+j;k1++)
				b[k1]=a[k1];
			for(k2=j;k2<i+j;k2++)
				d[k2]=a[i+j-k2-1+j];//????2????????????????
			for(l=j;l<i+j;l++)
			{
				if(b[l]==d[l])
					num++;
			}
			if(num==i)
			{
				for(m=j;m<i+j;m++)
					cout<<b[m];
				cout<<'\n';
			}
			else
				continue;
		}//????????????????
	}

	return 0;
}
int main() 
{
	char str[501];  
	int i, j, m,n, k, length, flag;
 	 //???????????????????????????
     cin >> str;                            
	 
	 length =  strlen(str);             //?????
	 
	 for (i = 2; i <= length; i++)  //???????????
		for (j = 0; j <= length - i; j++)//???????????
		{
			flag = 1;
			for (m = j, n = j + i - 1; m < n; m++, n--)
				if (str[m] != str[n])
				{
					flag = 0; break;
				}
			
			if (flag)
			{
				for (k = j; k <= j + i - 1; k ++)
					cout << str[k];
				cout << endl;
			}
		}
	
		return 0;
}
int main() {
    char a[600];
    cin>>a;
    int l,i,j,start,num;
    char box1[600],box2[600];
    for(l=2;l<=strlen(a);l++)
    {
    	for(start=0;start<=strlen(a)-l;start++)
    	{
    		memset(box1,600,'\0');
    		    		memset(box2,600,'\0');
    		num=0;
    		for(i=start;i<start+l;i++)
    		{
    			box1[num++]=a[i];
    		}
    		for(i=0;i<l;i++)
    		{
    			box2[i]=box1[l-1-i];
    		}
    		for(i=0;i<l;i++)
    		{
    			if(box1[i]!=box2[i])
    				break;
                if(i==l-1)
                {
                	for(j=0;j<l;j++)
                	{
                		cout<<box1[j];
                	}
                	cout<<endl;
                }
    		}

    		memset(box1,600,'\0');
    		memset(box2,600,'\0');
    	}
    }
	return 0;
}
int main()
{
	int flag,i,n;
	char a[501],*j,*l,*r;
	cin>>a;n=strlen(a);
	for(i=1;i<n;i++)
	{
		for(j=a;*(j+i);j++)
		{
			flag=1;
			for(l=j,r=j+i;l<r;l++,r--)
				if(*l!=*r){flag=0;break;}
			if(flag)
			{
				for(l=j;l<=j+i;l++)cout<<*l;
				cout<<endl;
			}
		}
	}
	return 0;
}
//****************************************
//*??:    ????             ** 
//*??: ???      		    **
//*???2011  11 15              **
//****************************************
int i , l ;
char str[501];      //??????? 

void f(int num,int len)        //???? 
{
	if(len <= 0 )     //?length?????????????
	{
		int j ;
		for(j = i ; j < i + l ; j++)
			cout << str[j];
		cout << endl;
	}
	else
	{
		if( str[num] == str[num + len - 1] )    //???????? 
			f(num + 1 , len - 2);    //?????? 
	}
}

int main()
{
	int lenth;           //?????? 
	cin.getline( str , 501 );         //?????? 
	lenth = strlen(str);         //???????? 
	for( l = 2 ; l <  lenth  ; l++)
		for( i = 0 ; i+l-1 <= lenth ; i++)//?? 
			f(i , l); //???? 
	return 0;
}
void print(int x,int y);//???????
char s[502];//???????
int main()
{
	int i,j,k=1,length;
	cin>>s;//??
	length=strlen(s);
	while(k<length)//k???????????
	{
	for(i=0,j=k;j<length;i++,j++)//?????????????????????????????????
	{
		int begin=i;int end=j;
		while(begin<end)
		{
			if(*(s+begin)!=*(s+end)) {break;}//???begin?end??????????????????
			else {begin++;end--;}//????????????????????????????
		}
		if(begin>=end)//??begin????end???a[i]?a[j]??k??????????
		{
			print(i,j);//??
		}
	}
	k++;//??+1??????????
	}
	return 0;
}

void print(int x,int y)//???????????
{
	for(int t=x;t<=y;t++)
	{
		cout<<*(s+t);
	}
	cout<<endl<<endl;
}
//************************************************
//*  ?????4.cpp                             *
//*  ?????? 1200012877                     *
//*  ???2012 ? 11 ? 18 ?                   *
//*  ?????????                          *
//************************************************
int main()
{
	char win[501];
	int sum,t=0;
	cin.getline(win,501);
	sum=strlen(win);
	for(int i=2;i<=500;i=i+2)
	{
		for(int j=0;j<sum;j++)
		{
			if (j+i-1>sum)break;
			if (win[j]==win[j+i-1])
			{
				t=0;
				for(int p=1;p<=(i/2)-1;p++)
				{
					if (win[j+p]==win[j+i-1-p])
					{
						t++;
					}
				}
				if (t==(i/2)-1)
				{
					for(int k=j;k<=j+i-1;k++)
					{
						cout<<win[k];
					}
				    cout<<endl;
				}
			}
		}
	}
	return 0;
}
int main()
{
	int i,j,a,h=0,k=0,m=0;
	char str[500];
	gets(str);
	a=strlen(str);
	for(j=1;j<(a-1);j++){
		for(i=0;(i+j)<a;i++){
			if((j-1)%2==0){
				for(k=0;k<=(j-1)/2;k++){
					if(str[i+k]!=str[i+j-k])
						h=1;
				}
			}
			else{
               for(k=0;k<=j/2;k++){
					if(str[i+k]!=str[i+j-k])
						h=1;
			   }
			}
			if(h==0){
			for(h=0;h<j;h++)
				printf("%c",str[i+h]);
				printf("%c\n",str[i+j]);
			}
			h=0;
		}
	}

	return 0;
}
int main()
{
	char a[501];
	int i, j, k, n, flag = 1;
	for (i = 0; ; i++)
	{
		cin.get(a[i]);
		if (a[i] == '\n')
			break;
	}
	n = --i;
	for (j = 1; j <= n; j++)
	{
		for (i = 0; i <= n; i++)
		{
			if (( i + j ) > n )
				continue;
			flag = 1;
			for (k = 0; k <= (j / 2) ; k++)
			{
				if (a[i + k] != a[i + j - k])
					flag = 0;
			}
			if (flag == 1)
			{
				for (k = i; k <= (i + j); k++)
					cout << a[k];
				cout << endl;
			}
		}
	}
	return 0;
}
main()
{
    int a,b,c,n,m;
    char x[510];
    gets(x);
    n=strlen(x);
    for(a=1;a<=n-1;a++)
    {
        for(b=0;b<=n-1-a;b++)
        {
            m=0;
            for(c=0;c<=a/2;c++)
            {
                if(x[b+c]!=x[b+a-c])
                m=1;
                else;
            }
            if(m==0)
            {
                for(c=b;c<=b+a;c++)
                printf("%c",x[c]);
                printf("\n");
            }
            else;
        }
    }
}
char array[N];
int main()
{
	cin>>array;
	int len=strlen(array);
	for(int t=2; t<=len; t++)//????????? 
	for(int i=0; i<=len-t; i++)
	{
		int sum=0;
		for(int j=0; j<t/2; j++)//????????? 
		{
			if(array[i+j]==array[i+t-1-j]) sum++;
		}
		if(sum==t/2)//? 
		{
			for(int j=i; j<i+t; j++)
			cout<<array[j];
			cout<<endl;
		}
	}
	return 0;
}
int main()
{
	char a[501];
	cin>>a;
	int n = strlen(a);
	char b[n];
	int i,j,k = 0,p,q,s = 0;

	for (i = 2;i < n;i++)
	{
		for (k = 0;k < n - i+1;k++)
		{
			s = 0;
			for (j = 0;j < i;j++)
		    {
				b[j] = a[k + j];
		    }

			for (p = 0,q = i-1;p < q;p++,q--)
				if (b[p] == b[q])
					s++;

			if (s == i/2)
		    {
				for(int x = 0;x < i;x++)
			    {
					if (x == i-1)
						cout<<b[x]<<endl;
				    else
					    cout<<b[x];
			    }
		    }
		}
	}
	return 0;
}
int main(){
	int m,i,j,k,c,g;
    char a[550];
    cin>>a;
    c=strlen(a);
    for(i=2;i<=c;i++){
    	for(j=0;j<c-i+1;j++){
    		g=0;
    		if(a[j]==a[j+i-1]){
    			if(i==2)cout<<a[j]<<a[j+i-1]<<endl;
    			else if(i%2==0&&i!=2){
    				for(k=1;k<=(i-2)/2;k++){
    				if(a[j+k]==a[j+i-1-k])
    					g++;
    				}
    				if(g==k-1){
    					for(m=j;m<j+i-1;m++)
    						cout<<a[m];
    					cout<<a[m]<<endl;
    				}
    			}
    			if(i==3)cout<<a[j]<<a[j+1]<<a[j+2]<<endl;
    			else if(i%2!=0){
    				for(k=1;k<(i-1)/2;k++){
    					if(a[j+k]==a[j+i-1-k])g++;
    				}
    				if(g==k-1){
    					for(m=j;m<j+i-1;m++)
    						cout<<a[m];
    					cout<<a[m]<<endl;
    				}
    			}
    		}
    	}
    }
	return 0;
}
int ishuiwen(char c[510])
{
    int i,f=1;
    for(i=0;i<strlen(c);i++)
    {
                            if(c[i]!=c[strlen(c)-i-1])
                            {
                                                      f=0;
                                                      break;
                            }
    }
    return (f);
}

int main()
{
    char c[510],jilu[510];
    int  i,j,k;
    gets(c);
    for(i=2;i<=strlen(c);i++)
    {
                             for(j=0;j<=(strlen(c)-i);j++)
                             {
                                                          for(k=j;k<(j+i);k++)
                                                          {
                                                                              jilu[k-j]=c[k];
                                                          }
                                                          jilu[i]='\0';
                                                          if(ishuiwen(jilu))
                                                          printf("%s\n",jilu);
                             }
    }
    return 0;
}
/*
 *??? 
 *2010 - 11 - 30 
 *?????5 - ???? 
 */
int main()
{
    int fun ( char [], int );//???? 
    char alp[501];
    cin >> alp;
    int i, j, k, l;
    l = strlen( alp );
    for ( i = 2; i <= l; i = i + 2 )//??????????????????????????????? 
    {
        for ( j = 0; j <= l - i; j++ )//???????????l-i? 
        {
            char str[501];
            for ( k = 0; k < i; k++ )
            {
                str[k] = alp[k + j];
            }
            str[i] = '\0';//?str???????????? 
            if ( fun ( str, i ) )//?????????????? 
               cout << str << endl;
        }
    }
    return 0;
}
int fun ( char str[], int a )
{
    int i, flag = 1;//flag???????????? 
    for ( i = 0; i <= a / 2; i++ )
    {
        if ( str[i] != str[a - i - 1] )//?????? 
        {
             flag = 0;//???? 
             return 0;//??0 
             break;
        }
    }
    if ( flag )//????? 
       return 1;//??1 
}
void huiwen( int k ,char a[] )
{
	int i,shime = 1 ;
	for ( i = 0 ; i <= k / 2 ; i ++ )
		if ( a[i] != a[ k - i - 1 ] )
			shime = 0 ;
	if ( shime )
	{
		for ( i = 0 ; i < k ; i ++ )
			cout << a[i];
		cout << endl;
	}
}
int main ()
{
	char yuan[500],yiduan[500];
	int n,i,j,k ;
	cin >> yuan ;
	n = strlen ( yuan ) ;
	for ( k = 2 ; k <= n ; k = k + 2 )
	{
		for ( i = 0 ; i + k <= n ; i ++ )
		{
			for ( j = i ; j <= i + k ; j ++ )
				yiduan[j - i] = yuan[j] ;
			huiwen ( k , yiduan );
		}
	}
	return 0 ;
}
int main()
{
	char a[100],c[50][50],e[50];
	int i,j,k,l,b,d=0;
	for(i=0;;i++)
	{
		scanf("%c",&a[i]);
		if(a[i]=='\n')
			break;
	}
	for(j=0;j<i;j++)
	{
		for(k=j+1;k<=i;k++)
		{
			b=0;
			for(l=j;l<=k;l++)
			{
				if(a[l]!=a[k+j-l])
				{
					b=1;
					break;
				}
			}
			if(b==0)
			{
				for(b=j;b<=k;b++)
					c[d][b-j]=a[b];
			c[d][k-j+1]='\0';
			d++;
			}
		}
	}
	for(i=2;i<100;i++)
	{
		for(j=0;j<d;j++)
		{
			if(strlen(c[j])==i)
				printf("%s\n",c[j]);
		}
	}
	return 0;
}
int main()
{
	char str[501]={'\0'};
	cin.getline(str,501);
	int i,j,k,n=0;
	for(n=0;str[n]!='\0';n++);
	
	for(i=1;i<n;i++)
	for(j=0;j<n-i;j++)
	{
		for(k=i;k>0;k--)
			if(str[j+i-k]!=str[j+k])
		    break;
		if(k==0)
		{
			for(k=j;k<=j+i;k++)
				cout<<str[k];
			cout<<endl;
		}
	}
	return 0;
}
int judge(char *p,int l)
{
	char *x,*t;
	t=p;
    int y=1;
	x=t+l-1;
	while ((t<=x) && y)
	{
		if (*t!=*x) y=0;
		t++;
		x--;
	}
	return y;
}
void pp(char *p,int l)
{
	int i;
	char *t;
	t=p;
	for (i=1;i<=l;i++)
		printf("%c",*(p+i-1));

printf("\n");
}
void main()
{
	char c[3243];
	int i,j,k,l;
	char *p;
	//freopen("tt.in","r",stdin);
	//freopen("tt.out","w",stdout);
	gets(c); l=strlen(c); p=c;
	for (i=2;i<=l;i++)
	
	 for (j=1;j<=l-i+1;j++)
         if (judge(p+j-1,i)) 
	    pp(p+j-1,i);
	
	
	

	
}
int main()
{
	char str[1000];
	int i, j, ii, jj, len, q;
	cin >> str;
	len = strlen(str);
	for (q = 2; q <= len; q++)
	{
	for (i = 1; str[i] != 0; i++)
	{
		ii = i;
		jj = i;
		if (str[i - 1] == str[i + 1])
		{
			while ((str[ii] == str[jj]) && (ii >= 0) && (str[jj] != 0))
			{
				if (ii != jj)
				{
					if (jj - ii + 1 == q){
					for (j = ii; j <= jj; j++)
						cout << str[j];
					cout << endl;}
				}	
				ii --;
				jj ++;
			}
		}
		/*else
			if ((str[i - 1] == str[i]))
			{
				ii --;
				while ((str[ii] == str[jj]) && (ii >= 0) && (str[jj] != 0))
			{
				if (ii != jj)
				{
					for (j = ii; j <= jj; j++)
						cout << str[j];
					cout << endl;
				}	
				ii --;
				jj ++;
			}
			}*/
			else
				if (str[i] == str[i + 1])
					{
				jj ++;
				while ((str[ii] == str[jj]) && (ii >= 0) && (str[jj] != 0))
			{
				if (ii != jj)
				{
					if (jj - ii + 1 == q)
					{
					for (j = ii; j <= jj; j++)
						cout << str[j];
					cout << endl;
					}
				}	
				ii --;
				jj ++;
			}
			}
	}  
	}
	return 0;
}
int main ()
{
	char a[500],b[10000][500]={0},c[10000]={0};
	int n,i,j,t=0,k,p=0,m,s=0;
	scanf("%s",a);
	n=strlen(a);
	for(j=2;j<=n;j++)
	{
		for(i=0;i<n+1-j;i++)
		{
			for(k=i;k<i+j;k++)
			{
				b[t][p]=a[k];
				p++;
			}
			b[t][p]='\0';
			t++;
			p=0;
		}
	}
	for(t=0;b[t][0]!='0';t++)
	{
		m=strlen(b[t]);
		for(i=0;i<m;i++)
		{
			c[i]=b[t][m-1-i];
		}
		for(i=0;i<m;i++)
		{
		if(c[i]==b[t][i])
		{
			s++;
		}
		}
		if(s==m)
			printf("%s\n",b[t]);
		s=0;
	}
	return 0;
}
char b[505];
int check(){
	int i,len,j;
	len=strlen(b);
	for(i=0,j=len-1;i<j;i++,j--)
		if(b[i]!=b[j])return 0;
		return 1;
}
void main()
{
	char a[510];
	int i,j,k,len;
	gets(a);
	len=strlen(a);
	for(i=2;i<=len;i++){
		for(j=0;j<=len-i;j++){
			for(k=0;k<i;k++){
				b[k]=a[k+j];
			}
			b[k]=0;
			if(check())printf("%s\n",b);
		}
	}
}
//**********************************************
//**???????******************************
//**?????? 1000012741*********************
//**???2010?11?26?************************
//**********************************************
void pal(char str[503], int m, int i)  //??pal?????????????????????
{
	int j = i, p = i + 1;  //????????????j?p
	while (str[j] == str[p] && j >= 0 && str[p] != '\0')  //????????????
	{
		j--; 
		p++;
		if (p != (i + 1) && ((p - j - 1) == m))  //?????????????
		{
			for (int k = j + 1; k < p; k++)  //????
				cout << str[k];
			cout << endl;
		}
	}
}
int main()
{
	char str[503]; 
	int i, j, k, p, m, l;  //m?????????l?????????
	cin >> str;  //?????
	l = strlen(str);  //????
	for (m = 2; m <= l; m = m + 2)  //??????????
	{
		for (i = 0; str[i + 1] != '\0'; i++)
			pal(str, m, i);	
	}
	for (m = 3; m <= l; m = m + 2)  //??????????
	{
		for (i = 0; str[i] != '\0'; i++)  //??????????
		{
			j = i - 1;
			p = i + 1;
			while (str[j] == str[p] && j >= 0 && str[p] != '\0')
			{
				j--;
				p++;
			}
			if (p != (i + 1) && ((p - j - 1) == m))  //?????????????
			{
				for (k = j + 1; k < p; k++)
					cout << str[k];  //????
				cout << endl;
			}
		}
	}
	return 0;
}
//**********************************************
int main()
{
   char p[501];
   scanf("%s",p);
   int len=strlen(p);
   for(int i=2;i<len;i++)
       {
       char **q=(char **)malloc(sizeof(char *)*len);
       for(int j=0;j<len-i+1;j++)
           {
               q[j]=(char *)malloc((i+1)*sizeof(char));
               for(int h=0;h<i+1;h++)
                   q[j][h]='\0';
               for(int h=0;h<i;h++)
                   q[j][h]=p[j+h];
           }   
       for(int j=0;j<len-i+1;j++)
            {
            char temp[501]={'\0'}; 
            int k=0;
            for(int h=i-1;h>=0;h--)
                {
                temp[k]=q[j][h];
                k++;   
                } 
            if(strcmp(temp,q[j])==0) 
               printf("%s\n",q[j]);                    
            }
       }         
}
int main ()
{
   char a[500],b[500],c[500];
   int i,k,j,l,m,h,x;
   gets(a);
   int n=strlen(a);
  
   for(i=1;i<n;i++)
    for(j=0;j<n-i;j++)
	{
	    m=0;
		x=0;
		for(k=j;k<=j+i;k++)
		{
			b[m]=a[k];
			m++;
		}
		for(l=0;l<m;l++)
		{
			c[l]=b[m-1-l];
		}
		for(h=0;h<m;h++)
		{
			if(b[h]!=c[h])
             x++;
			else x=x;
		}
		if(x==0)
		{
			for(k=j;k<=j+i;k++)
			printf("%c",a[k]);
			printf("\n");
		}
	}
   return 0;
}
/***************************************************************************
*autour:??? 
*number:1000012905
*description:???? 
****************************************************************************/
//hui ???????????????
int	hui(char a[], int n)
{
	int	k = (int) (n / 2);
	int	i;
	//?????? 
	for (i = 0; i <= k; i ++)
	{
		if(a[i] != a[n - 1 - i])
		{break;}
	}
	
	//?? 
	if(i == k + 1)
	{
		return 1;
	}
	else
	{
		return 0;
	}
}
int main()
{
	//?????????? 
	char 	str[500];
	int	sl = 0;
	cin.getline(str, 501);
	sl = strlen(str);

	int	i, j, k;
	char	jian[500];	//??????????
	int	jl = 0;		//?????? 
	for (i = 2; i <= sl; i ++)
	{
		for (j = 0; j <= sl - i; j ++)
		{
			//??????j???????i??? 
			for (k = j; k < j + i; k ++)
			{
				jian[k - j] = str[k];
			}
			jl = i;
			
			//?????????,????? 
			if(hui(jian, jl)) 
			{
				int	t;
				for (t = 0; t < jl; t ++)
				{
					cout << jian[t]; 
				}
				cout << endl;
			}
		}
	}
	return 0;
}
int main ()
{
	char str[505];
	int i, j, m, length, a[255][505] = {0}, flag = 0;
	cin.getline (str, 500);
	length = strlen(str);
	for (i = 0; i < length - 1; i++)
	{
		if (str[i] == str[i + 1])
		{
			a[0][i] = 1;
			j = 1;
			while (i + j + 1 < length && i - j >= 0)
			{
				if (str[i - j] == str[i + j + 1])
				{
					a[j][i] = 1;
					j++;
				}
				else
					break;
			}
		}
	}
	for (i = 0; i < length / 2; i++)
		for (j = 0; j <length - 1; j++)
		{
			if (a[i][j] == 1)
			{
				flag = 1;
				for (m = j - i; m <= j + 1 + i; m++)
					cout << str[m];
			}
			if (flag == 1)
			{
				cout << endl;
				flag = 0;
			}
		}
	return 0;
}
int panduan(char *a,int n)
{
	int i,j,k=0;
	for (i=0;i<n/2;i++)
	{
		if (*(a+i)!=*(a+n-1-i)) k=1;
	}
	if (k==1) return 0;
	else return 1;
}
int main()
{
	char c[200]={'\0'};
	char a[200][200]={'\0'};
	int i,j,k,l;
	scanf("%s",c);
	for (i=2;i<strlen(c);i++)
	{
		l=strlen(c)-i+1;
		for (j=0;j<l;j++)
		{
			for (k=0;k<i;k++)
			{
				*(*(a+j)+k)=*(c+j+k);
			}
		if (panduan(*(a+j),strlen(*(a+j)))==1)printf("%s\n",*(a+j));
		}
	    
	}
		return 0;
}
int main()
{
    char a[100000],b[1000];
    int l,i,j,t,p,q;
    scanf("%s",&a);
    l=strlen(a);
    for(i=1;i<l-1;i++)
    {
        for(j=0;j<l;j++)
        {
            t=j+i;
            p=j;
            do{
                    if(a[p]==a[t])
                     {
                           t=t-1;
                           p=p+1;
                     }
                     else
                     {
                         break;
                     }
            }while(t>p);
            if(t<=p)
            {
                for(q=j;q<(j+i);q++)
                {
                    printf("%c",a[q]);
                }
                 printf("%c\n",a[j+i]);
            }
        }
    }
    return 0;
}
int main()
{
	char a[501]={0};
	int i,j,k,t,m,q,p=0;
	gets(a);
	int b[501]={0};

	for(i=0;a[i]!='\0';i++)
		if(a[i]==a[i+1])
			b[i]=1;//????????
		
	for(j=1;j<250;j++)//j?????????  xuyaoxiugai!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
		{
			for(q=0;q<500;q++)
			{	p=0;
			if(b[q]==1)
			{
			for(t=0;t<j;t++)//<<<<<<<<<<========????????
			{if(a[q-t]==a[q+t+1])
			p++;}
			if(p==j)
				{for(m=0;m<2*j;m++)
					printf("%c",a[q-t+m+1]);
					printf("\n");}
				
			}}

	
	}}
//**********************
//*??????? **
//*?????? **
//*???1200012957 **
//*???2012-11-18 **
//***********************

int main ()
{
	char str[500];
	int i, j, k, len, m, n, count;
	cin.getline(str,500);
	len = strlen(str);
	// i + 1????????i???1??len - 1?
	for (i = 1; i < len; i++ )
	{
		// j??????????
		for (j = 0; j < len - i; j++ )
		{
			// ???i, j???????????????
			m = j;
			n = j + i;
			// ???????
			count = 0;
			// ?????????????????????
			while (str[m] == str[n] && m < n)
			{
				m++ ;
				n-- ;
				count++ ;
			}
			// ???????????????????count??[i / 2] + 1;
			if (count == i / 2 + 1)
			{
				// ?????????
				for (k = j; k <= j + i; k++ )
				{
					cout << str[k];
				}

				cout << endl;
			}
		}
	}

	return 0;
}
//******************************************
//*???????.cpp                     **
//*??: ??     1100012808              **
//*???2011.11.13                       **
//******************************************
void zch(char a[])
{
	int i = 0, j = 0, k = 0, flag = 0, l; 
	for (i = 2; i < strlen(a); i++)
	{
		for (j = 0; j <= strlen(a) - i; j++)
		{
			for (k = j; k < i / 2 + j; k++)
			{
				if (a[k] != a[i + j - 1 - (k - j)])
					break;
			}
			if (k == i / 2 + j)
			{
				for (l = j; l < i + j; l++)
					cout << a[l] ;
				cout << endl;
				cout << endl;
			}
		}
	}
	return;
}
int main()  //???
{        //?????
	char ch[100000];
	int i = 0;
	cin.getline(ch, 100000);
	zch(ch);
	return 0;
}
int main()
{
	int t,k,i,j,m;
	char c[500];
	for(i=0;;i++)
	{scanf("%c",&c[i]);
	if(c[i]=='\n') break;}
	t=i;
	for(k=2;k<=t;k++)
	{for(i=0;i<(t-k+1);i++)
	{for(j=i;j<=(i+k/2);j++)
	{if(c[j]!=c[2*i+k-1-j]) break;}
	if(j==(i+k/2+1)) 
	{for(m=i;m<i+k;m++)
	printf("%c",c[m]);
	if(m==i+k) printf("\n");}}}
	return 0;
}
int main()
{
	char a[500];
	int i, j, k, l, flag;
	gets(a);
	l = strlen(a);
	for (i = 1; i < l; i++)
		for (j = 0; j < l - i; j++)
		{
		   flag = 1;
		   for (k = j; k <= j + i; k++)
		       if (a[k] != a[2*j + i - k])
				   flag = 0;
		   if (flag)
		   {
			   for (k = j; k <= j + i; k++)
				  cout << a[k];
			   cout << endl;
		   }
		}
	return 0;
}
int main()
{
	char s[600];
	int len=2,j,m,i,g=0;
   cin>>s;
   for(len=2;len<=strlen(s);len++)//???????????
   {
	   for(j=0;j<strlen(s)-len+1;j++)
	   {

		   g=0;//??????????
		   for(m=0;m<=len/2-1;m++)
		   {
			 if(s[j+m]!=s[j+len-1-m]){g=1;break;} //??????????? ????g??????
		   }
		   if(g==0)
		   {
			   for(i=j;i<j+len;i++)
			   {
				   cout<<s[i];
			   }
			   cout<<endl;
		   }
	   }
   }
   return 0;
}
int main()
{
 	char str[510];
 	int len = 0, x, y;
 	
 	cin >> str;
 	len = strlen(str);
 	for ( int i = 1; i < len; i++ )
 	{
  	    for ( int j = 0; j < len - i; j++ )
  	    {
  		 	for ( x = j, y = j + i; x < y; x++, y-- )
  		 	{
	  	  	 	if ( str[x] != str[y] )
	  	  	 	   break;
			}

			if ( x >= y )
   			{
  	   		    for ( int m = j; m <= j + i; m++ )
  	   		    	cout << str[m];
  	   		    cout << endl;	
		 	}
  		}
  	}
  	return 0;
}
int main()
{
	char a[500];
	int i, j, k, w;
	cin.getline(a, 500);
	int len = strlen(a);
	for (i = 2; i <= len; i++)
	{
		if( i%2==0)
		{
			for( j =0;j <= len-i;j++)
			{
				for(w=0;w<i/2;w++)
				{
					if(a[j+w] != a[i+j-1-w])
					break;
				}
				if(w == i/2)
				{
					for(k = 0; k<i;k++)
						cout << a[j+k];
					cout << endl;
				}
			}
		}
		else
		{
			for( j =0;j <= len-i;j++)
			{
				for(w=0;w < i/2 - 1;w++)
				{
					if(a[j+w] != a[i+j-1-w])
					break;
				}
				if(w == i/2)
				{
					for(k = 0; k < i; k++)
						cout << a[j+k];
					cout << endl;
				}
			}
		}
	}
	return 0;
}