It's not a situation, it's a condition. Electromagnetic Hypersensitivity. For reasons unknown, my nervous system has become sensitized to certain frequencies of electromagnetic radiation.
- Chuck McGill, Better Call Saul
Chuck McGill suffers from electromagnetic hypersensitivity: he is afraid of electricity. But did you know he is also afraid of palindromes?
Once he received a string as a birthday present from Jimmy. He wants to rearrange its symbols, obtaining string , so that the following condition holds:
- For every , string is not a palindrome.
Can you help him?
As a reminder, a string is called a palindrome, if it reads the same backwards as forwards. For example, aibohphobia
is a palindrome.
Input data
The first line contains a single integer () - the number of test cases. The description of test cases follows.
The only line of each test case contains a string , consisting of lowercase Latin letters.
It is guaranteed that the sum of lengths of over all test cases does not exceed .
Output data
For each test case, if there is no such way to rearrange characters of , print NO
.
Otherwise, print YES
. On the next line output a single string . It should be the rearrangement of characters of , and it should satisfy the condition from the statement.
You can print YES
and NO
in any case (e.g. the strings yEs
, yes
, Yes
will be taken as a positive answer).
Example
stdin
5
a
sos
abba
icpc
tenet
stdout
YES
a
YES
oss
NO
YES
icpc
YES
tente