#include <bits/stdc++.h>
#define ll long long
#define fast ios::sync_with_stdio(false), cin.tie(0), cout.tie(0)
using namespace std;
int main()
{
    fast;
    int t;
    cin >> t;
    while (t--)
    {
        int flag = 1;
        string s;
        cin >> s;
        for (int i = 0; i < s.length(); i++)
        {
            if (s[i] != 'a')
            {
                flag = 0;
                break;
            }
        }
        if (flag==0)
        {
            cout << "YES\n";
            string t;
            t = s + 'a';
            int flag1 = 1;
            for (int i = 0; i < t.length(); i++)
            {
                if (t[i] != t[t.length() - 1 - i])
                {
                    flag1 = 0;
                    break;
                }
            }
            if (flag1==0)
                cout << t << '\n';
            else
            {
                t = 'a' + s;
                for (int i = 0; i < t.length(); i++)
                {
                    if (t[i] != t[t.length() - 1 - i])
                    {
                        flag1 = 0;
                        break;
                    }
                }
                cout<<t<<'\n';
            }
        }
        else
            cout << "NO\n";
    }
}