#include<bits/stdc++.h>
using namespace std;
typedef long long ll;

string input;

bool isp(string str){
    ll l=0, r=str.length()-1;
    //cout<<"str is "<<str<<endl;
    while(l<r){
        if(str[l]!=str[r]) return false;
        l++;
        r--;
    }

    return true;
}

void solve(){
    cin>>input;
    ll flag=0;
    for(int i=0;i<input.length();i++){
        if(input[i]!='a') {flag=1; break;}
    }

    if(flag){
        cout<<"YES"<<endl;
        if(!isp('a'+input)) cout<<'a'<<input<<endl;
        else cout<<input<<'a'<<endl;
    }else cout<<"NO"<<endl;
}

int main(){
    #ifdef DEBUG
    freopen("in.txt", "r", stdin);
    #endif
    
    int t;
    cin>>t;
    while(t--) solve();
    
    return 0;
}