#include <bits/stdc++.h>

using namespace std;

int main()
{
    string s;
    int t;
    cin>>t;
    while(t--)
    {
        cin>>s;
        bool jud=1;
        bool L=0,R=0;
        for(int i=0,j=s.length()-1;i<=j;i++,j--)
        {
            if(s[i]=='a'&&s[j]=='a') continue;
            else
            {
                if(s[i]=='a'&&s[j]!='a') L=1;
                else R=1;
                jud=0;
                break;
            }
        }
        if(jud) cout<<"NO"<<endl;
        else
        {
            cout<<"YES"<<endl;
            if(L) cout<<'a'<<s<<endl;
            else cout<<s<<'a'<<endl;
        }
    }
    return 0;
}
