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.

**Input:**

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.

**Output:**

For each test case in a new line print the required result.

**Constraints:**

1 <= T <= 100

1 <= N <= 1000

**Example:
Input:**

5

1324

3415436

1023422

03517

3555

**Output:**

4312

6543314

4322210

75310

5553

**Explanation:
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.

the_coder95 | 465 |

thanuvinu94 | 384 |

ShivayLamba | 256 |

adityasuman2025 | 249 |

PrakharBansal1 | 236 |

the_coder95 | 1691 |

RishabhTanwar1 | 1110 |

thanuvinu94 | 1060 |

samay_kam_hai | 724 |

themanhasnoname | 620 |

blackshadows | 5331 |

Ibrahim Nash | 5219 |

akhayrutdinov | 5111 |

mb1973 | 4897 |

Quandray | 4547 |

Login to report an issue on this page.