#include <stdio.h>
#include <fstream>
#include <stdint.h>
#include <map>
#include <vector>
#include <algorithm>
#include <unordered_map>
#include <math.h>
#include <cstring>
#include <iostream>


#define MOD 1000000007

using namespace std;

int8_t isPalindrome(string &str) {
  for(int32_t i = 0; i < str.size() / 2; i++) {
    if(str[i] != str[str.size() - i - 1]) {
      return 0;
    }
  }
  return 1;
}

int main() {
  int32_t t;
  cin >> t;
  while(t--) {
    string str;
    cin >> str;
    string fstr = str + "a", lstr = "a" + str;
    if(!isPalindrome(fstr)) {
      cout << "YES\n" << fstr << "\n";
      continue;
    }
    if(!isPalindrome(lstr)) {
      cout << "YES\n" << lstr << "\n";
      continue;
    }
    cout << "NO\n";
  }
}