#include<bits/stdc++.h>
using namespace std;
 
bool isPalin(string s)
{
    // cout << "s = " << s << '\n';
    int i, j, n = s.size();
    i = 0, j = n - 1;
    while (i < j) {
        if (s[i] != s[j]) {
            return false;
        }
        i++;
        j--;
    }
    return true;
}

void solve()
{
	string s;
    cin >> s;
    int n = s.size(), i;
    bool flag = true;
    for (i = 0; i < n; i++) {
        if (s[i] != 'a') {
            flag = false;
        }
    }
    if (flag) {
        cout << "NO\n";
        return;
    }
    cout << "YES\n";
    if (isPalin(s + 'a')) {
        cout << 'a' + s << '\n';
    }
    else {
        cout << s + 'a' << '\n';
    }
}
 
signed main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);cout.tie(0);
    int _t;cin>>_t;while(_t--)
    solve();
}