#include<bits/stdc++.h>
using namespace std;
// NEE METHOD EY RA DONGA NINJA CHITTI BABU

bool check(string k){
    int i=0,j=k.size()-1;
    while(i<j){
        if(k[i]!=k[j]){
            return 0;
        }
        i++;
        j--;
    }
    return 1;
}
void solve(){
    string s;
    cin>>s;
    int c=0;
    for(int i=0;i<s.size();i++){
        if(s[i]=='a'){
            c++;
        }
    }
    if(c==s.size()){
        cout<<"NO";
    }
    else{
        string chitti="";
        if(!check(s+"a")){
            cout<<"YES"<<endl;
            cout<<s+"a";
        }
        else if(!check(chitti+"a"+s)){
            cout<<"YES"<<endl;
            cout<<chitti+"a"+s;
        }
    }
    cout<<endl;
}
int main(){
    int t;
    cin>>t;
    while(t--){
        solve();
    }
    return 0;
}