#include <bits/stdc++.h>

using namespace std;

int main()
{
    int t;
    cin >> t;
    string s,s1,s2,s3,s4;
    while(t--)
    {
        cin >> s;

            s1=s+"a";
            s3=s1;


            s2="a"+s;
            s4=s2;
            reverse(s4.begin(),s4.end());
            reverse(s3.begin(),s3.end());

            if( s1.compare(s3)!=0)
        {
            cout << "YES" << endl;
            cout << s1 << endl;
        }

        else if(s2.compare(s4)!=0)
        {
            cout << "YES" << endl;
            cout << s2 << endl;

        }

        else
            cout << "NO" << endl;

    }

    return 0;
}
