Largest Possible Number

0

0 votes
Sorting
Problem

Given a number N, find out the largest number possible by rearranging its digits.

You are required to do this for T independent test cases.

Constraints

1T10

For subtask 1 (20 points): 1N106

For subtask 2 (30 points): 1N1018

For subtask 3 (50 points): 1N10105

Input Format

The first line contains a single integer T denoting the number of test cases.

Each of the T following lines contains a single integer N

Output Format

For each test case, print the answer in a single line.

Time Limit: 1
Memory Limit: 256
Source Limit:
Editor Image

?