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.awt.*;
import java.awt.geom.Area;
import java.io.*; 
import java.lang.reflect.Array;
import java.math.*;
import java.sql.SQLException;
import java.util.*;
import java.util.Map.Entry;

import javax.management.RuntimeErrorException;

import static java.lang.Math.*; 
   
public class Solution implements Runnable { 
        final boolean ONLINE_JUDGE = System.getProperty("ONLINE_JUDGE") != null; 
        BufferedReader in; 
        PrintWriter out; 
        StringTokenizer tok = new StringTokenizer(""); 
        String delim = " ";
          
        String readString() throws IOException { 
        	try {
	    		while(!tok.hasMoreTokens()) {
	    			tok = new StringTokenizer(in.readLine()); 
		        }
		        return tok.nextToken(delim);
	    	}
        	catch (Exception e){
        		return null;
	    	}
        }
         
        int readInt() throws IOException{ 
            return Integer.parseInt(readString()); 
        }   
        long readLong() throws IOException{ 
            return Long.parseLong(readString()); 
        }       
        double readDouble() throws IOException{ 
            return Double.parseDouble(readString()); 
        }        
        Point readPoint() throws IOException {
        	return new Point(readInt(), readInt());
        }        
        char readChar() throws IOException{
        	int x = 0;
        	while ((x = in.read()) == '\n' || x == '\r' || x == ' '){ }
        	return (char)x;
        }        
//----------------------------------          
        public class Three { 
            public int a, b, c; 
            public Three(){} 
            public Three(int a, int b, int c){this.a = a;this.b=b;this.c=c;} 
            public String toString(){ 
                return a + ":" + b + ":" + c; 
            }
        }
//---------------------------------------- 

        char[] getAns(char[] s, int n){
        	
        	int placePos = -1;
        	char c = 0;
        	for (int i = 0; i < n/2; i++){
        		if (s[i] != s[n-1-i]){
        			placePos = n-i;
        			c = s[i];
        			break;
        		}
        	}
        	
        	if (placePos == -1) {
        		placePos = n/2;
				c = s[placePos];
        	}
        	
        	
        	if (placePos == -1) return null;
        	
        	char[] ans = new char[s.length+1];
        	for (int i = 0; i < placePos; i++){
        		ans[i] = s[i];
        	}
        	ans[placePos] = c;
        	for (int i = placePos+1; i < n+1;i++){
        		ans[i] = s[i-1];
        	}
        	
        	for (int i = 0; i < (n+1)/2; i++){
        		if (ans[i] != ans[n-i]){
        			return null;
        		}
        	}        	
        	
        	return ans;
        }
        
        void solve() throws IOException {
        	char[] s = readString().toCharArray();
        	        	
        	char[] ss = new char[s.length];
        	for (int i = 0; i < s.length; i++){
        		ss[s.length-1-i] = s[i];
        	}
        	
        	char[] a = getAns(s, s.length);
        	char[] aa = getAns(ss, s.length);
        	
        	if (a == null && aa == null){
        		out.println("NA");
        		return;
        	}
        	if (a != null){
        		for (int i = 0; i < a.length; i++){
        			out.print(a[i]);
        		}
        		return;
        	}
        	if (aa != null){
        		for (int i = 0; i < aa.length; i++){
        			out.print(aa[i]);
        		}
        		return;
        	}
        }
        
//---------------------------------------- 
        public static void main(String[] args){ 
            new Thread(null, new Solution(), "", 256 * (1L << 20)).start(); 
        } 
         
        public void run(){ 
                try{ 
                        timeBegin = System.currentTimeMillis(); 
                        
                        try{ 
                            if (ONLINE_JUDGE){ 
                                in = new BufferedReader(new InputStreamReader(System.in)); 
                                out = new PrintWriter(System.out);
                            }  
                            else {                         
                            	in = new BufferedReader(new FileReader("input.txt")); 
                            	out = new PrintWriter("output.txt");                                 
                            } 
                        }catch(Throwable e){
                            in = new BufferedReader(new InputStreamReader(System.in)); 
                            out = new PrintWriter(System.out); 
                        }
                          
                        solve(); 
                        out.close(); 
                          
                        timeEnd = System.currentTimeMillis(); 
                        System.err.println("Time = " + (timeEnd - timeBegin)); 
                }catch (Exception e){ 
                        e.printStackTrace(System.err); 
                        System.exit(-1); 
                } 
        } 
         
        long timeBegin, timeEnd; 
}