#K44692. Lexicographically Smallest String

    ID: 27588 Type: Default 1000ms 256MiB

Lexicographically Smallest String

Lexicographically Smallest String

You are given t test cases. For each test case, you are given a string. Your task is to rearrange the characters of the string so that the resulting string is the lexicographically smallest possible.

The lexicographically smallest permutation of a string can be obtained by sorting its characters in non-decreasing order. Formally, for a string \( s \), the answer is given by:

\[ \text{answer} = \text{sort}(s) \]

Print the results for each test case on a new line.

inputFormat

The first line contains an integer t, the number of test cases. Each of the next t lines contains a single string.

outputFormat

For each test case, print the lexicographically smallest string possible by rearranging its characters. Each result should be printed on a new line.

## sample
3
bacd
dcba
badc
abcd

abcd abcd

</p>