#include <stdio.h>
#include <string.h>
int isSameChar(char a, char b){
return a
== b
|| abs(a
-b
) == abs('A'-'a'); }
int getline(char s[], int lim){
int c, i;
for(i
= 0; i
< lim
-1 && (c
=getchar()) != EOF
&& c
!= '\n'; ++i
) s[i] = c;
s[i] = '\0';
return i;
}
int main(void){
char buf[1024], str[1024];
getline(buf, 1024);
int i, j = 0;
for(i = 0; buf[i] != '\0'; ++i){
if(('a' <= buf[i] && buf[i] <= 'z') || ('A' <= buf[i] && buf[i] <= 'Z')){
str[j++] = buf[i];
str[j] = '\0';
}
}
--j;
for(i
= j
; i
>= 0; --i
) putchar(str
[i
]); for(i = 0; i <= j; ++i, --j){
if(!isSameChar(str[i], str[j])) break;
}
if(i
> j
) puts("Palindrome!"); return 0;
}
I2luY2x1ZGUgPHN0ZGlvLmg+CiNpbmNsdWRlIDxzdHJpbmcuaD4KCmludCBpc1NhbWVDaGFyKGNoYXIgYSwgY2hhciBiKXsKICAgIHJldHVybiBhID09IGIgfHwgYWJzKGEtYikgPT0gYWJzKCdBJy0nYScpOwp9CmludCBnZXRsaW5lKGNoYXIgc1tdLCBpbnQgbGltKXsKICAgIGludCBjLCBpOwogICAgZm9yKGkgPSAwOyBpIDwgbGltLTEgJiYgKGM9Z2V0Y2hhcigpKSAhPSBFT0YgJiYgYyAhPSAnXG4nOyArK2kpCiAgICAgICAgc1tpXSA9IGM7CiAgICBzW2ldID0gJ1wwJzsKICAgIHJldHVybiBpOwp9CgppbnQgbWFpbih2b2lkKXsKICAgIGNoYXIgYnVmWzEwMjRdLCBzdHJbMTAyNF07CiAgICBnZXRsaW5lKGJ1ZiwgMTAyNCk7CiAgICBpbnQgaSwgaiA9IDA7CiAgICBmb3IoaSA9IDA7IGJ1ZltpXSAhPSAnXDAnOyArK2kpewogICAgICAgIGlmKCgnYScgPD0gYnVmW2ldICYmIGJ1ZltpXSA8PSAneicpIHx8ICgnQScgPD0gYnVmW2ldICYmIGJ1ZltpXSA8PSAnWicpKXsKICAgICAgICAgICAgc3RyW2orK10gPSBidWZbaV07CiAgICAgICAgICAgIHN0cltqXSA9ICdcMCc7CiAgICAgICAgfQogICAgfQogICAgcHV0cyhzdHIpOwogICAgLS1qOwogICAgZm9yKGkgPSBqOyBpID49IDA7IC0taSkgcHV0Y2hhcihzdHJbaV0pOwogICAgcHV0Y2hhcignXG4nKTsKICAgIGZvcihpID0gMDsgaSA8PSBqOyArK2ksIC0tail7CiAgICAgICAgaWYoIWlzU2FtZUNoYXIoc3RyW2ldLCBzdHJbal0pKSBicmVhazsKICAgIH0KICAgIGlmKGkgPiBqKSBwdXRzKCJQYWxpbmRyb21lISIpOwogICAgcmV0dXJuIDA7Cn0KCgoK