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

bool ispalin(string s) {
	for (int i = 0; i < s.length() / 2; i++) {
		if (s[i] != s[s.length()-1 - i]) return 0;
	}

	return 1;
}

signed main() {
	ios_base::sync_with_stdio(false); cin.tie(NULL);

	int tt; cin >> tt;

	while (tt--) {
		string s; cin >> s;
		string s1 = 'a' + s, s2 = s + 'a';

		if (!ispalin(s1)) cout << "YES\n" << s1 << '\n';
		else if (!ispalin(s2)) cout << "YES\n" << s2 << '\n';
		else cout << "NO\n";
	}	
}