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

//
// My personnal C++ template
//

typedef int64_t ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<string, string> pss;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<pii> vii;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef unsigned int uint;

#define fi first
#define se second
#define mp make_pair
#define mt make_tuple
#define pb push_back
#define pqt priority_queue;

#define IO                                                                     \
    do {                                                                       \
        ios_base::sync_with_stdio(false);                                      \
        cin.tie(NULL);                                                         \
        cout.tie(NULL);                                                        \
    } while (false)

#define FOR(a, b, c) for (int a = (b); a < (c); ++a)
#define FORN(a, b, c) for (int a = (b); a <= (c); ++a)
#define FORD(a, b, c) for (int a = (b); a >= (c); --a)
#define FORC(a, b, c) for (char a = (b); a <= (c); ++a)
#define FOREACH(a, b) for (auto &a : (b))
#define REP(i, n) FOR(i, 0, n)
#define REPN(i, n) FORN(i, 1, n)
#define MAX(a, b) a = max(a, b)
#define MIN(a, b) a = min(a, b)

int main() {
    IO;

    int t;
    cin >> t;
    REP(ncase, t) {
        string s;
        cin >> s;

        int index = -1;
        for (int i = 0; i < (int)s.size(); i++) {
            if (s[i] != 'a') {
                index = i;
                break;
            }
        }

        if (index == -1) {
            cout << "NO" << endl;
        } else {
            cout << "YES" << endl;
            for (int i = 0; i < (int)s.size(); i++) {
                cout << s[i];
                if (i == (int)s.size() - 1 - index) {
                    cout << 'a';
                }
            }
            cout << endl;
        }
    }

    return 0;
}
