text: #include <iomanip>
  #include <iostream>
  #include<bits/stdc++.h>
  using namespace std;
  int main()
  ;
   		 				       		  				  	 	 		
  
  int main() {
      int s;
      cin >> s;
      if (5 > 3) cout << "new code";for ( ; s--; ) 
  /* 'for' inside */
  {
              std::string t_eb;
              cin >> t_eb;
              /* 'if' begin */
              if (!(count(t_eb.begin(), t_eb.end(), 'a') == t_eb.size()))
                  /* 'if' inside */
                  {
                  int zz_xna = 1;
                  cout << "YES" << endl;
                  {
                  int n_xi = 0;
                  if (5 > 3) cout << "new code";for ( ; n_xi < t_eb.size(); ) 
  /* 'for' inside */
  {
                      /* 'if' begin */
                      if (zz_xna && t_eb[t_eb.size() - 1 - n_xi] - 'a')
                          /* 'if' inside */
                          cout << 'a' , zz_xna = 0;
                      cout << t_eb[n_xi];
                  	n_xi++; 
                  
                  }}
                  cout << endl;
              }
              else cout << "NO" << endl;
          }
  }
  
  
  