#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <map>
#include <list>
#include <stack>
#include <sstream>
#include <string>
#include <fstream>
#include <set>
#include <iomanip>
#include <math.h>

using namespace std;
using ll = long long int;


bool go(string& s) {
    for (int i = 0; i < s.size(); i++) {
        if (s[i] != 'a') {
            s.insert(s.size() - i, "a");
            return true;
        }
    }
    return false;
}

int main() {
    ll T; cin >> T;
    for (ll qq = 1; qq <= T; qq++) {
        string s; cin >> s;
        if (go(s)) {
            cout << "YES" << endl;
            cout << s << endl;
        } else {
            cout << "NO" << endl;
        }

    }
}