#harish
n=int(input())
temp=n
rev=0
if(n<=1000):
	while(n>0):
		dig=n%10
		rev=rev*10+dig
		n=n//10
	if(rev==temp):
		print("palindrome")
	else:
		print("not a palindrome")
else:
	print("invalid")

bd5fa4716c5f6294146bf4c253c0d946bc200a25
<mask token>

<mask token>
if n <= 1000:
    while n > 0:
        dig = n % 10
        rev = rev * 10 + dig
        n = n // 10
    if rev == temp:
        print('palindrome')
    else:
        print('not a palindrome')
else:
    print('invalid')

n = int(input())
temp = n
rev = 0
if n <= 1000:
    while n > 0:
        dig = n % 10
        rev = rev * 10 + dig
        n = n // 10
    if rev == temp:
        print('palindrome')
    else:
        print('not a palindrome')
else:
    print('invalid')

#harish
n=int(input())
temp=n
rev=0
if(n<=1000):
	while(n>0):
		dig=n%10
		rev=rev*10+dig
		n=n//10
	if(rev==temp):
		print("palindrome")
	else:
		print("not a palindrome")
else:
	print("invalid")
