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

string fun(string s){
      string s2="";
      string s1 = string(s.rbegin() , s.rend());

      if(s == s1){
            s2+='a';
            s2+=s;
      } else{
         if(s[0] == 'a' && s[s.size()-1] == 'a'){
            int a = 0 , a1 = 0;
            for(int i = 0 ; i<s.size() ; ++i){
                if(s[i] == 'a')a++;
                else break;
            }

             for(int i = s.size() -1 ; i >= 0 ; --i){
                if(s[i] == 'a')a1++;
                else break;
            }

            if(a > a1){
                s2+='a';
                s2+=s;
            }else{
              s2+=s;
              s2+='a';

            }

         }else{
            if(s[0] == 'a'){
              s2+='a';
              s2+=s;
            } else{
             s2+=s;
             s2+='a';
            }
         }
      }

      return s2;
}



int main()
{
    int t;
    cin >> t;

    while(t--){
        string s ;

        cin >> s ;
        int a = 0;
        for(int i = 0 ; i < s.size() ; ++i){
            if(s[i] == 'a') a++;
        }


        if(a == int(s.size())){
            cout<<"NO"<<endl;
            continue;
        }
        cout<<"YES"<<endl;
        cout<<fun(s)<<endl;



    }


    return 0;
}

