#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <cstdio>
#include <cmath>
#include <cstring>
#include <string>
#include <algorithm>
#include <vector>
#include <queue>
#include <map>
#include <set>
#include <stack>
using namespace std;
typedef long long ll;
int a[200005];
set<char>st;
bool check(string s)
{
    int len = s.length();
    for (int i = 0; 2 * i + 1 <= len; i++)
        if (s[i] != s[len - 1 - i])return true;
    return false;
}
int main()
{
    int i, j, k, n, m, t, g, p, q, u, v, w, x, y;
    string s;
    string ss;
    cin >> t;
    while (t--)
    {
        cin >> s;
        st.clear();
        for (auto& x : s)st.insert(x);
        if (st.size() == 1&&s[0]=='a')puts("NO");
        else
        {
            puts("YES");
            ss = 'a' + s;
            if (check(ss))
                cout << ss << endl;
            else cout << s + 'a' << endl;
        }
    }
    return 0;
}