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.
// All important imports
 
import static java.lang.System.in;
import java.io.BufferedReader;
import java.io.ByteArrayInputStream;
import java.io.DataInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.math.BigInteger;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.BitSet;
import java.util.Collections;
import java.util.Comparator;
import java.util.Date;
import java.util.GregorianCalendar;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Hashtable;
import java.util.InputMismatchException;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Stack;
import java.util.Queue;
import java.util.StringTokenizer;
import java.util.TreeMap;
import java.util.Vector;
 
 
/**
 * 
 * @author Mustafa Filmwala
 * Built using Netbeans IDE 8.0.1
 */


public class Main{
    
        
        public static void solve() throws IOException
        {  
            int r,a,b,c,d,i,j;
            String s1=ns();
            char s[]=s1.toCharArray();
            int n=s.length;
            c=n/2;
            for(i=0;i<n;i++){if(s[i]!=s[n-1-i]){c=i;break;}}
            StringBuilder sb=new StringBuilder(s1);
            StringBuilder sb1=new StringBuilder(s1);
            StringBuilder sb2=new StringBuilder(s1);
            StringBuilder sb3=new StringBuilder(s1);
            sb=sb.insert(c,s[c]);
            sb1=sb1.insert(n-c,s[n-1-c]);
            sb2=sb2.insert(c,s[n-1-c]);
            sb3=sb3.insert(n-c,s[c]);
            if(isPalindrome(sb.toString()))out.println(sb.toString());
            else if(isPalindrome(sb1.toString()))out.println(sb1.toString());
            else if(isPalindrome(sb2.toString()))out.println(sb2.toString());
            else if(isPalindrome(sb3.toString()))out.println(sb3.toString());
            else out.println("NA");
        }
        
       
         public static boolean isPalindrome(String a)
    {
        int len=a.length();
        if(len==1)return true;
        if(len==0)return false;
        if(len==2)return a.charAt(0)==a.charAt(1);
 
            int i=0;
            while(i<=len/2+1)
            {
                if(a.charAt(i)!=a.charAt(len-i-1))
                {return false;}
                i++;
            }
             return true;
    }
 

         
    
  
        static String TESTCASES;
        static PrintWriter out;
    public static void main(String[] args) throws Exception {
                long endTime,startTime=System.currentTimeMillis();
                
                out=new PrintWriter(System.out);
                InputStream myinp=System.in;
                init(myinp);
                solve();
                out.close();
                endTime=System.currentTimeMillis();
                
                  }
        
        static InputStream is;
        static BufferedReader brr;
        public static void init(InputStream input) {
        is=input;
        brr=new BufferedReader(new InputStreamReader(input));
        }
        
    
    protected static byte[] inbuf = new byte[1024];
    static int lenbuf = 0, ptrbuf = 0;
    
    protected static int readByte()
    {
        if(lenbuf == -1)throw new InputMismatchException();
        if(ptrbuf >= lenbuf){
            ptrbuf = 0;
            try { lenbuf = is.read(inbuf); } catch (IOException e) { throw new InputMismatchException(); }
            if(lenbuf <= 0)return -1;
        }
        return inbuf[ptrbuf++];
    }
        
        protected static String readline() throws IOException
        {
            return brr.readLine();
        }
                
    
    
    // extras
    protected static double nd() { return Double.parseDouble(ns()); }
    protected static char nc() { return (char)skip(); }
    protected static boolean isSpaceChar(int c) { return !(c >= 33 && c <= 126); }
    protected static int skip() { 
            int b; while((b = readByte()) != -1 && isSpaceChar(b)); return b; 
        }
        
        
    protected static String ns()
    {
        int b = skip();
        StringBuilder sb = new StringBuilder();
        while(!(isSpaceChar(b))){ // when nextLine, (isSpaceChar(b) && b != ' ')
            sb.appendCodePoint(b);
            b = readByte();
        }
        return sb.toString();
    }
    
    protected static char[] nca(int n)
    {
        char[] buf = new char[n];
        int b = skip(), p = 0;
        while(p < n && !(isSpaceChar(b))){
            buf[p++] = (char)b;
            b = readByte();
        }
        return n == p ? buf : Arrays.copyOf(buf, p);
    }
    
    
    protected static int[] nia(int n)
    {
        int[] a = new int[n];
        for(int i = 0;i < n;i++)a[i] = ni();
        return a;
    }
        
        protected static int[][] niaindex(int n)
        {
                int ea[][]=new int[n][2];
                for(int i=0;i<n;i++)
                {
                    ea[i][0]=ni();
                    ea[i][1]=i;
                }
                return ea;
        }
        
        protected static long[] nla(int n)
    {
        long[] a = new long[n];
        for(int i = 0;i < n;i++)a[i] = nl();
        return a;
    }
        
        protected static long[][] nlaindex(int n)
        {
                long ea[][]=new long[n][2];
                for(int i=0;i<n;i++)
                {
                    ea[i][0]=ni();
                    ea[i][1]=i;
                }
                return ea;
        }
        
        protected static String[] nsa(int n)
    {
        String[] a = new String[n];
        for(int i = 0;i < n;i++)a[i] = ns();
        return a;
    }
        
        protected static double[] nda(int n)
    {
        double[] a = new double[n];
        for(int i = 0;i < n;i++)a[i] = nd();
        return a;
    }
    
    protected static int ni()
    {
        int num = 0, b;
        boolean minus = false;
        while((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'));
        if(b == '-'){
            minus = true;
            b = readByte();
        }
        
        while(true){
            if(b >= '0' && b <= '9'){
                num = num * 10 + (b - '0');
            }else{
                return minus ? -num : num;
            }
            b = readByte();
        }
    }
    
    protected static long nl()
    {
        long num = 0;
        int b;
        boolean minus = false;
        while((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'));
        if(b == '-'){
            minus = true;
            b = readByte();
        }
        
        while(true){
            if(b >= '0' && b <= '9'){
                num = num * 10 + (b - '0');
            }else{
                return minus ? -num : num;
            }
            b = readByte();
        }
    }
        
        
        // Outputs
        public static void pln(){out.println();}
        public static void ps(String s){out.print(s);}
        public static void pi(int s){out.print(s);}
        public static void pl(long s){out.print(s);}
        public static void pd(double s){out.print(s);}
        public static void psp(){out.print(" ");}
        public static void parr(int s[]){out.println(Arrays.toString(s));}
        public static void parr(String s[]){out.println(Arrays.toString(s));}
        public static void parr(long s[]){out.println(Arrays.toString(s));}        
        public static void parr2(int s[][]){for(int i=0;i<s.length;i++)out.println(Arrays.toString(s[i]));}
        public static void parr2(long s[][]){for(int i=0;i<s.length;i++)out.println(Arrays.toString(s[i]));}
        public static void parr2(String s[][]){for(int i=0;i<s.length;i++)out.println(Arrays.toString(s[i]));}
 
}
 
 
    