#C2258. Near Palindrome

    ID: 45554 Type: Default 1000ms 256MiB

Near Palindrome

Near Palindrome

Given a string s consisting of lowercase letters, determine whether it can be transformed into a palindrome by modifying at most one character. A palindrome is defined as a string that reads the same forward and backward. In other words, a string is a near palindrome if replacing at most one character can make it a palindrome.

Formally, for a string s of length n, it is a near palindrome if there exists at most one index i such that changing s[i] makes the string a palindrome. There is no need to output the modified string, just state whether the string is a "near palindrome" or "not a near palindrome".

inputFormat

The input is read from stdin and consists of a single string s containing only lowercase letters.

outputFormat

Output to stdout a single line: output "near palindrome" if the string can be converted into a palindrome by changing at most one character, otherwise output "not a near palindrome".

## sample
abca
near palindrome