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;
}