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.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.PriorityQueue;
import java.util.Queue;
import java.util.Random;
import java.util.Scanner;
import java.util.Stack;
import java.util.StringTokenizer;
import java.util.TreeSet;
import java.util.concurrent.LinkedBlockingDeque;

import javax.swing.border.Border;

public class a {

	public static long mod = (long) Math.pow(10, 9) + 7;
	public static int k = 0;

	private static class node {
		long num;
		int k;
		int index;

		node(long m, int k, int index) {
			num = m;
			this.k = k;
			this.index = index;
		}

	}

	public static class point implements Comparable<point> {
		long x;
		long y;
		long b;

		point(long x, long y, long b) {
			this.x = x;
			this.y = y;
			this.b = b;
		}

		@Override
		public int compareTo(point o) {
			if (k == 0)
				return (int) (o.x - x);
			else
				return (int) (y - o.y);

		}
	}

	public static int ch(long y) {
		int r = Long.bitCount(y);
		return r;
	}

	public static long gcd(long x, long y) {
		if (y == 0)
			return x;

		return gcd(y, x % y);
	}

	public static boolean ch[] = new boolean[10000005];
	public static ArrayList<Integer> prime = new ArrayList();

	// public static Queue<Integer> pp;

	public static void sieve(int k) {
		ch[0] = ch[1] = true;

		for (int i = 2; i <= k; i++) {
			if (!ch[i]) {
				prime.add(i);
				// pp.add(i);
				for (long j = (long) i * (long) i; j <= k; j += i) {
					ch[(int) j] = true;
				}
			}
		}

	}

	public static long pw(int x, int power, int mod) {
		if (power == 1)
			return x % mod;
		else if (power % 2 == 0)
			return pw((x % mod * x % mod) % mod, power / 2, mod);
		else
			return (pw(x, power - 1, mod) % mod * x % mod) % mod;

	}

	public static int solve(String y) {
		int p1 = y.length() - 1;
		int c1 = 0;
		int index = 0;
		int rr = y.length() / 2;
		for (int i = 0; i < rr; i++) {
			if (i == y.length())
				break;
			// System.out.println(y.charAt(i));
			if (y.charAt(i) != y.charAt(p1)) {
				c1++;
				index = p1;
				rr++;

			} else {
				p1--;
			}

			if (p1 < 0)
				break;

		}
		return c1;
	}

	public static int solve2(String y) {
		int p1 = y.length() - 1;
		int c1 = 0;
		int index = 0;
		for (int i = 0; i < y.length() / 2; i++) {
			if (y.charAt(i) != y.charAt(p1)) {
				c1++;
				index = p1 + 1;

			} else {
				p1--;
			}
			if (p1 < 0)
				break;

		}
		return index;
	}

	public static char solve3(String y) {
		int p1 = y.length() - 1;
		int c1 = 0;
		int index = 0;
		char a = 'a';
		for (int i = 0; i < y.length() / 2; i++) {
			if (y.charAt(i) != y.charAt(p1)) {
				c1++;
				index = p1 + 1;
				a = y.charAt(i);

			} else {
				p1--;
			}
			if (p1 < 0)
				break;

		}
		return a;
	}

	public static int solve4(String y) {
		int p1 = y.length() - 1;
		int c1 = 0;
		int index = 0;
		int rr = y.length() / 2;
		for (int i = 0; i < rr; i++) {
			//System.out.println(y.charAt(i) + " " + y.charAt(p1));
			if (i == y.length())
				break;
			if (y.charAt(i) != y.charAt(p1)) {
				c1++;
				index = p1;
				i--;
				rr++;

			}

			p1--;
			if (p1 < 0)
				break;

		}
		return c1;
	}

	public static int solve5(String y) {
		int p1 = y.length() - 1;
		int c1 = 0;
		int index = 0;
		for (int i = 0; i < y.length() / 2; i++) {
			if (y.charAt(i) != y.charAt(p1)) {
				c1++;
				index = i;
				i--;

			}
			p1--;
			if (p1 < 0)
				break;

		}
		return index;
	}

	public static char solve6(String y) {
		int p1 = y.length() - 1;
		int c1 = 0;
		int index = 0;
		char a = 'a';
		for (int i = 0; i < y.length() / 2; i++) {
			if (y.charAt(i) != y.charAt(p1)) {
				c1++;
				a = y.charAt(p1);
				i--;

			}
			p1--;
			if (p1 < 0)
				break;

		}
		return a;
	}

	public static void main(String[] args) throws IOException {
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		// BufferedReader in = new BufferedReader(new FileReader(
		// "in.txt"));
		StringBuilder qq = new StringBuilder();
		PrintWriter out = new PrintWriter(new OutputStreamWriter(System.out));
		// PrintWriter out = new PrintWriter(new FileWriter("out.txt"));

		// int n = Integer.parseInt(in.readLine());
		// String y[] = in.readLine().split(" ");
		// int a[] = new int[n];
		// for (int i = 0; i < n; i++) {
		// a[i] = Integer.parseInt(y[i]);
		// }
		String y = in.readLine();

		int c1 = solve(y);
		int c2 = solve4(y);
		//System.out.println(c1 + " " + c2);
		if (c1 == 0) {
			if (y.length() % 2 == 0) {
				for (int i = 0; i < y.length() / 2; i++) {
					out.print(y.charAt(i));
				}
				out.print("a");
				for (int i = y.length() / 2; i < y.length(); i++) {
					out.print(y.charAt(i));
				}
			} else {
				for (int i = 0; i < y.length() / 2; i++) {
					out.print(y.charAt(i));
				}
				out.print(y.charAt(y.length() / 2));
				for (int i = y.length() / 2; i < y.length(); i++) {
					out.print(y.charAt(i));
				}
			}
		} else if (c1 == 1) {

			char ans[] = new char[y.length() + 1];
			int indx = solve2(y);
			char k = solve3(y);
			int p = 0;
			for (int i = 0; i < y.length() + 1; i++) {
				if (i == indx) {
					ans[i] = k;
					continue;
				}
				ans[i] = y.charAt(p);
				p++;

			}

			for (int i = 0; i < ans.length; i++) {
				out.print(ans[i]);
			}
		} else if (c2 == 1) {
			// System.out.println("A");
			char ans[] = new char[y.length() + 1];
			int indx = solve5(y);
			char k = solve6(y);
			int p = 0;
			for (int i = 0; i < y.length() + 1; i++) {
				if (i == indx) {
					ans[i] = k;
					continue;
				}
				ans[i] = y.charAt(p);
				p++;

			}
			for (int i = 0; i < ans.length; i++) {
				out.print(ans[i]);
			}

		} else {
			System.out.println("NA");
		}
		out.close();

	}
}