#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define optimize() ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define endl '\n'

int main() 
{
    optimize();

    int t;
    cin>>t;
 
    while (t--){
        string s;
        cin>>s;

        int f=1;

        for(int i=0;i<s.size();i++){
          if(s[i]!='a'){
            f=0;
          }
        }
        if(f==1){
          cout<<"NO"<<endl;
        }else{

          cout<<"YES"<<endl;
          string s1=s+'a';
          string s2=s1;

          reverse(s2.begin(),s2.end());

          if(s1==s2){
            cout<<'a'+s<<endl;
          }else{
            cout<<s+'a'<<endl;
          }
        }
    }
    
    return 0;
}