As usual Babul is back with his problem but this time with numbers. In his problem there is a number P(always a whole number) with N digits. Now he started finding out the largest possible even number formed by rearranging this N digit number. For example consider number 1324, after rearranging the digits the largest even number possible is 4312.
Note: In case the number does not contain any even digit then output the largest odd number possible.
The first line of input will contain an integer T which is the number of testcases. Each of the next T lines will contain a number P.
For each test case in a new line print the required result.
1 <= T <= 100
1 <= N <= 1000
Testcase 1: The largest even number formed will be: 4312.
If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.