import java.io.*;
/** 21 Settembre 2013
* Write a description of class Palindromo here.
* A palindrome is a word or sentence that reads the same forward as it does backward.
* This program checks out if an input string is a palindrome.
Test it with - aveva - radar - ingegni - onorarono - aia
- ala - non - Anna - otto - oro - inni - afa - ossesso
* @author (your name)
* @version (a version number or a date) */
public class Palindrome {
public static void main (String args[]) throws Exception{
BufferedReader tastiera = new BufferedReader(new InputStreamReader(System.in));
System.out.println("Write the word to check: ");
String word=tastiera.readLine();
int lword=word.length();
int mword=(lword/2);
boolean flag=false; //false=palindrome - true=not palindrome
for(int i=0; i<=mword-1; i++){
if(!(word.charAt(i)==word.charAt(lword-i-1))) flag=true;
}
if(flag==true)
System.out.println("NOT PALINDROME");
else
System.out.println("PALINDROME");
} }