// #include <iostream>
// #include<string>
// #include <vector>
// #include <algorithm>
// #include <iomanip>
// #include <cmath>
// #include <map>
// #include<unordered_map>
#include<bits/stdc++.h>
using namespace std;
// #define forn(i, n) for (int i = 0; i < int(n); i++)
#define pb push_back
using ll =long long;
int N=1e7+10;
//vector<int>isprime(N,1);
//void _isprime()
// {
// isprime[1]=isprime[0]=0;
// for(int i=2;i<N;i++)
// {
// if(isprime[i]==1)
// {
// for(int j=2*i;j<N;j+=i)
// {
// isprime[j]=0;
// }
// }
// }
// }
int bToD(string n)
{
string num = n;
int dec_value = 0;
// Initializing base value to 1, i.e 2^0
int base = 1;
int len = num.length();
for (int i = len - 1; i >= 0; i--) {
if (num[i] == '1')
dec_value += base;
base = base * 2;
}
return dec_value;
}
// bool isprime(ll a)
// {
// if(a==1)
// {
// return true;
// }
// for(ll i=2;i<=sqrt(a);i++)
// {
// if(a%i==0)
// {
// return false;
// }
// }
// return true;
// }
string DecimalToBinary(int num)
{
string str;
while(num){
if(num & 1) // 1
str+='1';
else // 0
str+='0';
num>>=1; // Right Shift by 1
}
return str;
}
long long binconvert(int n)
{
long long bin = 0;
int rem, i = 1;
while (n!=0) {
rem = n % 2;
n /= 2;
bin += rem * i;
i *= 10;
}
return bin;
}
int arr[23];
void facto()
{arr[0]=1;
arr[1]=1;
arr[2]=2;
for(int i=3;i<=22;i++)
{
arr[i]=arr[i-1]+arr[i-2];
}
}
double factorial(int n) {
if(n == 0)
return 1;
double factorial = 1;
for (double i = 2; i <= n; i++)
factorial = factorial * i;
return factorial;
}
ll gcd(ll a,ll b)
{
if(b==0)
{
return a;
}
return gcd(b,a%b);
}
int lcsub(string S,char K)
{
int currc = 0, prevc = 0, maxl;
for (int i = 0; i < S.size(); i++)
{
if (S[i] == K) {
currc += 1;
}
else {
prevc = max(prevc, currc);
currc = 0;
}
}
prevc = max(prevc, currc);
maxl = prevc;
return maxl;
}
ll sum(string s)
{
int sum1=0;
for(auto i:s)
{
sum1+=int(i-48);
}
return sum1;
}
ll nCr(ll n, ll r) {
return factorial(n) / (factorial(r) * factorial(n - r));
}
void solve()
{
string s;
cin>>s;
int n=s.size()+1;
for(int i=0;i<n;i++)
{
for(int j='a';j<'z'+1;j++)
{
string t=s.substr(0,i)+string(1,j)+s.substr(i);
string u=t;
reverse(u.begin(),u.end());
if(u==t)
{
cout<<t<<endl;
return;
}
}
}
cout<<"NA"<<endl;
}
int main() {
// freopen("input.txt","r",stdin);freopen("output.txt","w",stdout);
// facto();
int t=1;
//cin>>t;
while(t--)
{
solve();
}
//cout<<"hfheng";
}
1200. Minimum Absolute Difference | 1619B - Squares and Cubes |
1619A - Square String | 1629B - GCD Arrays |
1629A - Download More RAM | 1629C - Meximum Array |
1629D - Peculiar Movie Preferences | 1629E - Grid Xor |
1629F1 - Game on Sum (Easy Version) | 2148. Count Elements With Strictly Smaller and Greater Elements |
2149. Rearrange Array Elements by Sign | 2150. Find All Lonely Numbers in the Array |
2151. Maximum Good People Based on Statements | 2144. Minimum Cost of Buying Candies With Discount |
Non empty subsets | 1630A - And Matching |
1630B - Range and Partition | 1630C - Paint the Middle |
1630D - Flipping Range | 1328A - Divisibility Problem |
339A - Helpful Maths | 4A - Watermelon |
476A - Dreamoon and Stairs | 1409A - Yet Another Two Integers Problem |
977A - Wrong Subtraction | 263A - Beautiful Matrix |
180C - Letter | 151A - Soft Drinking |
1352A - Sum of Round Numbers | 281A - Word Capitalization |