#include <iostream.h>
#include <string.h>
#include <stdio.h>

bool palindrom(char *s)
{
	int i,j;
	for (i=0,j=strlen(s)-1; i<=j; i++,j--)
	{
		while (s[i] == ' ')
			i++;
		while (s[j] == ' ')
			j--;
	    if (s[i] != s[j])
			return false;
	}
	return true;
}

void main(void)
{
	char sz[80];
//	cin >> sz;
	gets(sz);
	if (palindrom(sz))
		cout << sz << " palindrom";
	else
		cout << sz << " nem palindrom";
}