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

#define MAX_MSG_LEN 100

/* Declaration */
void palindrome(char *msg);

/* Implementation */
void palindrome(char *msg) {
	
	memset(msg, '\0', MAX_MSG_LEN);
	char *t = msg;
	while(1){
		*msg = getchar();
		if(*msg == ' ' || *msg == ','){
			continue;
		}
		if(*msg == '.' || *msg == '!' || *msg == '?')
			break;
		*msg = toupper(*msg);
		msg++;
	}
	for(int i = 0;i < (msg - t) / 2;i++){
		if(*(t + i) != *(msg - i)){
		printf("Not a palindrome");
		return;
		}
	}
	printf("Palindrome");
	return;
}

int main(void) {

    char msg[MAX_MSG_LEN];

    palindrome(msg);

    return 0;
}






