Problem: Mr. Kitayuta has kindly given you a string s consisting of lowercase English letters. You are asked to insert exactly one lowercase English letter into s to make it a palindrome. A palindrome is a string that reads the same forward and backward. For example, "noon", "testset" and "a" are all palindromes, while "test" and "kitayuta" are not.

You can choose any lowercase English letter, and insert it to any position of s, possibly to the beginning or the end of s. You have to insert a letter even if the given string is already a palindrome.

If it is possible to insert one lowercase English letter into s so that the resulting string will be a palindrome, print the string after the insertion. Otherwise, print "NA" (without quotes, case-sensitive). In case there is more than one palindrome that can be obtained, you are allowed to print any of them.

Input

The only line of the input contains a string s (1 ≤ |s| ≤ 10). Each character in s is a lowercase English letter.

Output

If it is possible to turn s into a palindrome by inserting one lowercase English letter, print the resulting string in a single line. Otherwise, print "NA" (without quotes, case-sensitive). In case there is more than one solution, any of them will be accepted. 

Examples

Input

revive


Output

reviver


Input

ee


Output

eye

Input

kitayuta


Output

NA

Note

For the first sample, insert 'r' to the end of "revive" to obtain a palindrome "reviver".

For the second sample, there is more than one solution. For example, "eve" will also be accepted.

For the third sample, it is not possible to turn "kitayuta" into a palindrome by just inserting one letter.

Solution (in JAVA):

Solution:

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;

public class A {

    
    public void solve(){
        
        String s = in.nextLine();
        int j = s.length() -1;
        
        for(int i = 0; i<=s.length(); i++){
            if(i>0 && i == s.length() /2){
                j++;
            }
            String t = s.substring(0, i) + s.charAt(j--) + s.substring(i);
            if(isPali(t)){
                out.println(t);
                return;
            }
        }
        out.println("NA");
        
    }
    
    public boolean isPali(String s){
        int j = s.length() -1;
        
        for(int i = 0; i<j; i++){
            if(s.charAt(i) != s.charAt(j)){
                return false;
            }
            j--;
        }
        return true;
        
    }
    
//  public void solve(){
//      
//      String s = in.nextLine();
//      int j = s.length() -1;
//      boolean flag = false;
//      
//      int ind = -1;
//      String c = "";
//      boolean left = false;
//      for(int i = 0; i<j; i++){
//          if(s.charAt(i) != s.charAt(j)){
//              if(flag){
//                  
//                  other(s);
//                  return;
//              }
//              else if( i <= j - 1 && s.charAt(i) == s.charAt(j-1)){
//                  ind = i;
//                  left = true;
//                  c = Character.toString(s.charAt(j));
//                  j--;
//                  flag = true;
//              }
//              else if( i+1 <= j && s.charAt(i+1) == s.charAt(j)){
//                  ind = j;
//                  c = Character.toString(s.charAt(i));
//                  i++;
//                  flag = true;
//              }
//          
//              else{
//                  other(s);
//                  out.flush();
//                  return;
//              }
//              
//          }
//          j--;
//      }
//      
//      if(flag){
//          if(left){
//              out.println(s.substring(0, ind ) + c + s.substring(ind));
//          }
//          else{
//              out.println(s.substring(0, ind + 1) + c + s.substring(ind + 1));
//          }   
//      }
//      else if(s.length() % 2 == 0){
//          out.println(s.substring(0,s.length() /2 ) + "a" + s.substring(s.length() /2 ));
//      }
//      else {
//          out.println(s.substring(0, j+1) + s.charAt(j) + s.substring( j+1));
//      }
//      
//      
//  }
//
//  public void other(String s){
//      int j = s.length() -1;
//      boolean flag = false;
//      
//      int ind = -1;
//      String c = "";
//      boolean left = false;
//      for(int i = 0; i<j; i++){
//          if(s.charAt(i) != s.charAt(j)){
//              if(flag){
//                  out.println("NA");
//                  out.flush();
//                  return;
//              }
//              else if( i+1 <= j && s.charAt(i+1) == s.charAt(j)){
//                  ind = j;
//                  c = Character.toString(s.charAt(i));
//                  i++;
//                  flag = true;
//              }
//              else if( i <= j - 1 && s.charAt(i) == s.charAt(j-1)){
//                  ind = i;
//                  left = true;
//                  c = Character.toString(s.charAt(j));
//                  j--;
//                  flag = true;
//              }
//              else{
//                  out.println("NA");
//                  out.flush();
//                  return;
//              }
//              
//          }
//          j--;
//      }
//      if(flag){
//          if(left){
//              out.println(s.substring(0, ind ) + c + s.substring(ind));
//          }
//          else{
//              out.println(s.substring(0, ind + 1) + c + s.substring(ind + 1));
//          }   
//      }
//      else if(s.length() % 2 == 0){
//          out.println(s.substring(0,s.length() /2 ) + "a" + s.substring(s.length() /2 ));
//      }
//      else {
//          out.println(s.substring(0, j+1) + s.charAt(j) + s.substring( j+1));
//      }
//  }
//  
    public static void main(String[] args){
        A m = new A();
        m.solve();
        m.out.flush();
        m.out.close();
    }
    
    
    
    InputStream inputStream;
    OutputStream outputStream;
    InputReader in;
    PrintWriter out;
    
    public A(){
        inputStream = System.in;
        outputStream = System.out;
        in = new InputReader(inputStream);
        out = new PrintWriter(outputStream);    
    }
    
}

class InputReader {
    public BufferedReader reader;
    public StringTokenizer tokenizer;

    public InputReader(InputStream stream) {
        reader = new BufferedReader(new InputStreamReader(stream), 32768);
        tokenizer = null;
    }

    public String next() {
        while (tokenizer == null || !tokenizer.hasMoreTokens()) {
            try {
                tokenizer = new StringTokenizer(reader.readLine());
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }
        
        return tokenizer.nextToken();
    }
    public String nextLine(){
        while (tokenizer == null || !tokenizer.hasMoreTokens()) {
            try {
                tokenizer = new StringTokenizer(reader.readLine());
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }
        String s = "";
        while(tokenizer.hasMoreTokens()){
            s += tokenizer.nextToken();
            if(tokenizer.hasMoreTokens()){
                s+=" ";
            }
        }
        
        return s;
    
    }

    public int nextInt() {
        return Integer.parseInt(next());
    }
    public double nextDouble(){
        return Double.parseDouble(next());
    }
    
    public long nextLong(){
        return Long.parseLong(next());
    }
    
    public float nextFloat(){
        return Float.parseFloat(next());
    }
    
    

}