#include <bits/stdc++.h>
#include <string>
using namespace std;


//---------------------------------------------Debug---------------------------------------------------------------------
void __print(int x) {cerr << x;}
void __print(long x) {cerr << x;}
void __print(long long x) {cerr << x;}
void __print(unsigned x) {cerr << x;}
void __print(unsigned long x) {cerr << x;}
void __print(unsigned long long x) {cerr << x;}
void __print(float x) {cerr << x;}
void __print(double x) {cerr << x;}
void __print(long double x) {cerr << x;}
void __print(char x) {cerr << '\'' << x << '\'';}
void __print(const char *x) {cerr << '\"' << x << '\"';}
void __print(const string &x) {cerr << '\"' << x << '\"';}
void __print(bool x) {cerr << (x ? "true" : "false");}

template<typename T, typename V>
void __print(const pair<T, V> &x) {cerr << '{'; __print(x.first); cerr << ','; __print(x.second); cerr << '}';}
template<typename T>
void __print(const T &x) {int f = 0; cerr << '{'; for (auto &i: x) cerr << (f++ ? "," : ""), __print(i); cerr << "}";}
void _print() {cerr << "]\n";}
template <typename T, typename... V>
void _print(T t, V... v) {__print(t); if (sizeof...(v)) cerr << ", "; _print(v...);}


// ---------------------------------------------------------Defines----------------------------------------------------------
#define PI               2*acos(0.0)
#define mem(a,b)         memset(a, b, sizeof(a))
#define pb(a)            push_back(a)
#define MP               make_pair
#define EPS              10E-10
#define ff               first
#define ss               second
#define mod              1000000007
#define fast_cin         ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define sz(a)            (int)a.size()
#define UNIQUE(v)        (v).erase(unique((v).begin(),(v).end()),(v).end())
#define all(a)           a.begin(),a.end()
#define infinity         0x3f3f3f3f
#define gcd(a, b)        __gcd(a, b)
#define lcm(a, b)        ((a)*((b)/gcd(a,b)))
#define endl             "\n"
#define D(x)            cerr << __LINE__ << ": " << #x << " = " << (x) << '\n'
#define DBG              cerr << __LINE__ << ": Hi" << '\n'
//-----------------------------------------------------------Types-----------------------------------------------------------
typedef long long ll;
typedef double db;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<pii>vii;
typedef vector<pll>vll;

////----------------------Graph Moves----------------
const int fx[]={+1,-1,+0,+0};
const int fy[]={+0,+0,+1,-1};
//const int fx[]={+0,+0,+1,-1,-1,+1,-1,+1};   // Kings Move
//const int fy[]={-1,+1,+0,+0,+1,+1,-1,-1};  // Kings Move
//const int fx[]={-2, -2, -1, -1,  1,  1,  2,  2};  // Knights Move
//const int fy[]={-1,  1, -2,  2, -2,  2, -1,  1}; // Knights Move
/*------------------------------------------------*/

/*-----------------------Bitmask------------------*/
ll Set(ll &N, ll pos) {return N = N | (1 << pos);}
ll reset(ll &N, ll pos) {return N = N & ~(1 << pos);}
bool check(ll N, ll pos) {return (bool)(N & (1 << pos));}
/*------------------------------------------------*/

void init() {
#ifndef ONLINE_JUDGE
#define debug(x...) cerr << "[" << #x << "] = ["; _print(x)
#else
#define debug(x...)
#endif
    fast_cin;
// #ifndef ONLINE_JUDGE
//     freopen("input.txt", "r", stdin);
//     freopen("output.txt", "w", stdout);
// #endif
}

// bool isPrime ( ll n ) {
//     if ( n <= 1 ) return false;
//     int sqrtn = sqrt(n);
//     for ( ll i = 2; i <= sqrtn; i++ ) {
//         if ( n % i == 0 ) return false;
//     }
//     return true;
// }


void Binary(ll x)
{
    for (int  i = 32; i >= 0; i--) {
        if ((1 << i)&x)cerr << "1";
        else cerr << "0";
    }
    cerr << "\n";
}
bool cmp(const pair<int, int> &a,
         const pair<int, int> &b)
{
    return (a.second > b.second);
}

ll ncr(int n,int r){
	// (n-1)ck + (n-1)c(k-1) = nck;
   	ll ans = 1;
   	if(r > n-r)r = n-r;
   	for(ll i = 1;i<=r;i++){
   		ans*=(n-i+1), ans/=i;
   	}return ans;
}

ll pow(ll a, ll b) {
    ll res = 1;
    while (b > 0) {
        if (b & 1)res = (res * a) % mod;
        b >>= 1;
        a = (a * a) % mod;
    }
    return res;
}

void solve(){
	string s;cin >> s;
	if(count(all(s), 'a') == sz(s)){
		cout << "NO\n";
		return;
	}
	cout << "YES\n";
	// int ind;
	// int n = sz(s);
	string t = s + 'a';
	bool flag =0;
	for(int i = 0;i<sz(t)/2;i++){
		if(t[i] != t[sz(t)-i-1])flag = 1;
	}
	if(flag){
		cout << t<< endl;
	}
	else{
		cout << 'a';
		cout << s <<endl;
	}
	
}

int main() {
    init();
	// int tc = 1;
	// cout << "Case " << tc++ << ": ";
    int t;cin >> t;
    while (t--) {
        solve();
    }
    return 0;
}
 