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.
import java.applet.Applet;
import java.applet.AudioClip;
import java.awt.BorderLayout;
import java.awt.EventQueue;
import java.awt.GraphicsEnvironment;
import java.awt.List;
import java.awt.Toolkit;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.Console;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.io.ObjectInputStream.GetField;
import java.math.BigInteger;
import java.net.MalformedURLException;
import java.net.URL;
import java.security.SecureRandom;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Calendar;
import java.util.Collections;
import java.util.Comparator;
import java.util.Date;
import java.util.HashSet;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.ListIterator;
import java.util.Scanner;
import java.util.TreeSet;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.util.regex.PatternSyntaxException;

import javax.sound.sampled.Clip;



public   class Main  implements Comparator<String> {
     
   static String [] SS,SS1;
   static String S1,S,str;


   static int n,k;


   	private static String [] al = {"a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"};
 
   
   public static void main (String [] arg) {
           
	   
		Scanner s  = new Scanner(System.in);
           PrintWriter out = new PrintWriter(System.out);
         
           
           S=s.next();
           
       
           StringBuilder Sb = new StringBuilder(S);
           int  num = 0;
           int  p = 0 ;
           
           while(p<=S.length()) {
        	   
        	   for(int i=0;i<al.length;i++) {
        		
        		  Sb=Sb.insert(p, al[i]);
        		   
        		  if(palindrom(Sb.toString())) {
        			  System.out.println(Sb);
        			  num++;
        			  break;
        		  }
        		  
        		  Sb=Sb.delete(p, p+1);
        		  
        	   } if(num>0) break;
        	   
        	   Sb=Sb.delete(0, Sb.length());
        	   Sb=Sb.append(S);
        	   p++;
        	  
           }
           
          
        	   
           if(num==0) {
        	   System.out.println("NA");
           }
           
      
         
     
    /*       S=s.nextLine();
       	
       	
       	try {
       		 
       	   Pattern pattern = Pattern.compile("([0-1]?[0-9]?[0-9]?\\.|[2][0-4][0-9]\\.|[2][5][0-5]\\.)([0-1]?[0-9]?[0-9]?\\.|[2][0-4][0-9]\\.|[2][5][0-5]\\.)"+
       			   								"([0-1]?[0-9]?[0-9]?\\.|[2][0-4][0-9]\\.|[2][5][0-5]\\.)([0-1]?[0-9]?[0-9]?|[2][0-4][0-9]||[2][5][0-5])");
       				 								
       		 Matcher matcher = pattern.matcher(S);
       		 boolean bool = matcher.matches();
       		 if(bool) {
       			 System.out.println("1");
       		 }
       		 else {
       			 System.out.println("0");
       		 }
       	
       	} catch (PatternSyntaxException e) {
       		e.printStackTrace();
       	}     	
		*/
   
            
 /*      ProcessBuilder pb = new ProcessBuilder("C:\\Program Files (x86)\\JetBrains\\IntelliJ IDEA 14.0\\bin\\idea.exe");
       try {
		pb.start();
	} catch (IOException e) {
	
		e.printStackTrace();
	}

 */
    
    
/*try  {
 
     BufferedReader reader = new BufferedReader(new FileReader("input.txt"));
     BufferedWriter writer = new BufferedWriter(new FileWriter("output.txt"));

        String S = null;    
        while((S = reader.readLine()) != null) {
        	System.out.println(S);
        
        }
     
        reader.close();
        writer.close();
     } catch(IOException e) {
         e.printStackTrace();
     }*/
 
     
   
           
     
 }	
   /*
    * Сдвиг массива
    */
   static int []  array (int [] array) {
	 
	 
     int k = 3; //на сколько сдвинем влево
     for (int i = 0; i < 1; i++) {
          int tmp = array[0];
          for (int j = 0; j < array.length - 1; j++) 
               array[j] = array[j+1];
          	array[array.length - 1] = tmp;
     }
   return array;
 }
   	
   static int som (int a, int b) {
	   if(a<b) return 1;
	   else if(a==b) return 0;
	   else return 2;
	  // return a < b ? 1 : a==b ? 0 : 2;
   }
   		
   	static long skobki (int n) {
   		 			  			
   		long [] C = new long [n+1];
   				
   			C[0]=1; 
   			  for (int i=1; i<=n; i++)   
   			  { 
   			    C[i]=0; 
   			    for (int j=0; j<i; j++) 
   			      C[i]+=C[j]*C[i-1-j]; 
   			  } 
   			   			
   				return C[n];
   			}
   			     		   

	   		static int solve(int n ) {
	   			int num = 0;
	   			while(n/5>0) {
	   				num+=n/5;
	   				n=n/5;
	   			}
	   			return num;
	   		}
	   			
	   
       public static void bubbleSort (int [] a) {
           for(int i=0;i<a.length;i++) {
               for(int j=i+1;j<a.length;j++) {
                   if(a[i]>a[j]) {
                       int temp = a[i];
                       a[i]=a[j];
                       a[j]=temp;
                   }
               }
           }
       }
   
   public static void swap (int [] a,int start,int end) {
       
       int temp = a[start];
       a[start]=a[end];
       a[end]=temp;
       
       }

  static  void quicksort(int [] mas, int first, int last)   {
      
      int mid;
      int f=first, l=last;
      mid=mas[(f+l) / 2]; 
              do    {
                      while (mas[f]>mid) f++;
                      while (mas[l]<mid) l--;
                          if (f<=l)    {
                                  swap(mas,f,l);
                                  f++;
                                  l--;
                          }
              }
              while (f<l);
              if (first<l) quicksort(mas, first, l);
              if (f<last) quicksort(mas, f, last);
       }
      
      static String toBinary (BigInteger big) {
          String S = ""; BigInteger two = new BigInteger("2");
          while(big.compareTo(BigInteger.ZERO)==1) {
              S=big.mod(two)+S;
              big=big.divide(two);
          }
          return S;
      }
         
      
       static int [] shuffle (int [] a) {
              
          for(int i=0;i<a.length;i++) {
              int rand = (int)(Math.random()*a.length);
              
              for(int j=0;j<a.length;j++) {
                  int temp = a[j];
                  a[j]=a[rand];
                  a[rand]=temp;
              }
              
          }
              return a;
          }
    
      
      static long s (long n) {
          
          StringBuilder S = new StringBuilder(Long.toString(n));
          S=S.reverse();
          n=n+Long.parseLong(S.toString());
          return n;
          
      } 
            
      static long gcd (long a, long b) {
          return (b==0) ? a : gcd(b,a%b);
      }
      
      static long nok (long a ,long b) {
    	  long gcd = gcd(a,b);
          long p =a*b;
          return p/gcd;
      }


      static BigInteger toDecany (String S) {
             
             BigInteger b = new BigInteger(S);
          
             BigInteger  k ,two = new BigInteger("2");

             BigInteger sum = BigInteger.ZERO;
             int i = 0;
             while(b.compareTo(BigInteger.ZERO)==1) {
                 k=b.mod(BigInteger.TEN);
                 sum=sum.add((k.multiply(two.pow(i))));
                 i++;
                 b=b.divide(BigInteger.TEN);
             }
                     
             return sum;
          }
      
    static boolean prime(int n) {
    	if(n<2) return false;
          for(int i=2;i*i<=n;i++) 
              if(n%i==0) return false; 
          	return true;
      }
    
	static boolean palindrom (String S) {

    int num = 0;
    for(int i=0;i<S.length()/2;i++) {
        if(S.charAt(i)==S.charAt(S.length()-i-1)) num++;
    }
    return num==S.length()/2;
    
}
  
      static int binary (int key ,int [] a) {
             int lo = 0;
             int hi = a.length-1;
             
             while(lo<=hi) {
             
                 int med =lo + (hi-lo)/2;
                 
                 if(key<a[med]) hi=med-1;
                 else if (key>a[med]) lo=med+1;
                 else return med;
                 
             }
         
            return -1;
         }

  
 static BigInteger fibonacci (int n) {

	 if(n<=1) return BigInteger.ONE;
	 
		 BigInteger [] arr = new BigInteger [n+1];
		 arr[0]=BigInteger.ONE; arr[1]=BigInteger.ONE;
		 for(int i=2;i<=n;i++) {
			 arr[i]=arr[i-1].add(arr[i-2]);
		 }
	 
	 return arr[n];
 }

 static BigInteger solve(int a,int b) {
	 
	 BigInteger sum = BigInteger.ZERO;
	 
	 for(int i=a;i<=b;i++) {
		 sum=sum.add(fibonacci(i));
	 }
	 
	 
	return sum.mod(BigInteger.valueOf(1000000000));
	 
 }

@Override
public int compare(String o1, String o2) {
   
       return o1.length()-o2.length();
}

 
 


}