//In rememberance to GOD//   //May GOD take care to me,my family and all the creatures//   #include<bits/stdc++.h>   using namespace std;            #define ll long long   #define int ll      #define mod ((int)1e9+7)   #define pii pair<int,int>   #define vi vector<int>   #define vvi vector<vi>   #define vc vector<char>   #define vpi vector<pii>   #define vpic vector<pair<int,char>>   #define vpid vector<pair<int,double>>   #define INF (ll)1e15   #define all(x)  (x).begin(),(x).end()   #define allr(x) (x).rbegin(),(x).rend()   #define pb push_back   #define rep(i, begin, end) for (__typeof(end) i = (begin) - ((begin) > (end)); i != (end) - ((begin) > (end)); i += 1 - 2 * ((begin) > (end)))   #define eb emplace_back      #define error(args...) { string _s = #args; replace(_s.begin(), _s.end(),  , ,    ); stringstream _ss(_s); istream_iterator<string> _it(_ss); err(_it, args); }      void err(istream_iterator<string> it) {}   template<typename T, typename... Args>   void err(istream_iterator<string> it, T a, Args... args) {    cerr << *it <<   =   << a << endl;    err(++it, args...);   }      #define debug(...) fprintf(stderr, __VA_ARGS__), fflush(stderr)   #define time__(d)        for (            auto blockTime = make_pair(chrono::high_resolution_clock::now(), true);            blockTime.second;            debug( %s: %lld ms n , d, chrono::duration_cast<chrono::milliseconds>(chrono::high_resolution_clock::now() - blockTime.first).count()), blockTime.second = false        )      //fill memset iota function   // use 1ll<<number(left shift)      const int N=((int)1e6);            // int primes[N];   // // int spf[N];   // vector<int> pr;      // void sieve(){      //     // iota(spf+2,spf+N,2);      //  for(ll i=2;i<N;i++){   //   if(primes[i]==0){   //     pr.eb(i*i);   //    for(ll j=i*i;j<N;j+=i){   //                 // if(spf[j]==j)   //                 // spf[j]=i;   //     primes[j]=1;   //    }   //   }   //   primes[i]^=1;   //  }      // }   // nloglogn               ll gcd(ll a, ll b) {if (b > a) {return gcd(b, a);} if (b == 0) {return a;} return gcd(b, a % b);}   void swap(int &x, int &y) {int temp = x; x = y; y = temp;}   ll mod_add(ll a, ll b, ll m) {a = a % m; b = b % m; return (((a + b) % m) + m) % m;}   ll mod_mul(ll a, ll b, ll m) {a = a % m; b = b % m; return (((a * b) % m) + m) % m;}   ll mod_sub(ll a, ll b, ll m) {a = a % m; b = b % m; return (((a - b) % m) + m) % m;}   ll power(ll x, ll y,ll m) {ll res = 1;while (y > 0){ if (y & 1) res = (res*x)%m;y = y>>1;x = x*x%m;}return res;}   //avoid it in power of 2.   //logn implementation   //divisors in o(sqrt(n)) and no of divisors less than 2*(n^1/2);//128(max divisors for n<=1e5)   //for n>=1e5 no of divisors is less than n^1/3;   // use i&1 instead of i%2   //stoll convert string to integer(long long)   //  if(a>b) { return a/b+fun(b,a%b);} else return b/a+fun(a,b%a); technique of mod and minus similar answer but diffent time complexity.   // if(a>b) { return 1+fun(b,a-b);} else return 1+fun(a,b-a);   // class cmp { public:   //     bool operator()(const pair<int,pii> &p1,const pair<int,pii> &p2) const { if(p1.first!=p2.first) return p1.first>p2.first;else   //         {   //             if(p1.second.first!=p2.second.first)   //             {   //                 return p1.second.first>p2.second.first;   //             }   //             else   //             {   //                 return p1.second.second>p2.second.second;   //             }                  //         }              //     }       // };   // instead of priority queue i use set defined with cmp class strictly using  =  sign in comparisons(work as multi set)   //erase function with values won t work   //to modify a set i use cmp class stictly without using  =  sign in comparions,example above!!!!     //erase function with values will work                        /////////////////////////////////////// CODE ////////////////////////////////////////////////         // int dx[] = {1,0,-1,0};   // int dy[] = {0,1,0,-1};                  // vi adj[N];   // int visited[N];   // int par[N];   // int d[N];            // int binary_searching(int a,int y)   // {   //     int start=-1;   //     int end=a;      //     while(start+1!=end)   //     {   //         int mid=(start+end)/2;   //         if(mid>(a-y))   //         {   //             end=mid;   //         }   //         else   //         {   //             start=mid;   //         }   //     }      //     return end;                    // }         bool palin(string s)   {       int n=s.size();                 for(int i=0;i<n/2;i++)       {           if(s[i]!=s[n-i-1])           {               return false;           }       }          return true;   }            void solve()   {       string s;       cin>>s;          bool flag=false;          for(int i=0;i<s.size();i++)       {           if(s[i]!= a )           {               flag=true;               break;           }       }          if(!flag)       {           cout<< NO <<  n ;           return;       }          //appling to first;       string temp;       // temp=s;          temp= a +s;       if(!palin(temp))       {           cout<< YES <<  n ;           cout<<temp<<  n ;           return;       }          temp=s+ a ;          if(!palin(temp))       {           cout<< YES <<  n ;           cout<<temp<<  n ;       }                                                                                                      }                           int32_t main()   {       #ifndef ONLINE_JUDGE           freopen( input.txt ,  r , stdin);           freopen( output.txt ,  w , stdout);       #endif          ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);          int t;       cin>>t;             // sieve();                    // t=1;                 for(int i=1;i<=t;i++)       {           solve();           // time__( solve );       }       return 0;   }