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

#define ll long long
#define vi vector<int>
#define vvi vector<vector<int> >
#define vll vector<long long>
#define vvll vector<vector<long long> >
#define pii pair<int,int>
#define pll pair<long long, long long>
#define pb push_back
#define mp make_pair


int main(){
	
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
	
	int t; cin>>t;
	while(t--){
		string s; cin>>s;
		int j=-1;
		for(int i=0;i<s.length();i++){
			if(s[i]!='a'){
				j=i; break;
			}
		}
		if(j==-1) cout<<"NO\n";
		else{
			cout<<"YES\n";
			int ind=s.length()-j-1;
			int n=s.length();
			for(int i=0;i<s.length();i++){
				if(ind<n/2 && i==ind) cout<<"a";
				cout<<s[i];
				if(ind>=n/2 && i==ind) cout<<"a";
			}
			cout<<"\n";
		}
	}

}