10911091 SUSTech Online Judge
Problem 1091 --Easy Sorting

1091: Easy Sorting

Time Limit: 1 Sec  Memory Limit: 128 MB
Submit: 27  Solved: 21
[Submit][Status][Web Board]

Description

A young child can calculate a sum only if the summands follow in non-decreasing order. For example, he can't calculate sum 1+3+2+1 but he can calculate sums 1+1+2 and 3+3.

You've got the sum that was written on the board. Rearrange the summans and print the sum in such a way that the child can calculate the sum.(The sum only contains numbers from 1-9)

Input

The first line is number T(T<=20), which indicates the number of test case;

For next T lines, each line contains a case with form(x1+x2+x3...+xn)(1<=n<=100000, 1<=xi<=9);


Output

For each case

Print the new sum that the baby can calculate.

Sample Input

2
3+2+1
1+1+3+1+3

Sample Output

1+2+3
1+1+1+3+3

HINT

Two possible solutions I can accept, If you find your solution runs more than 100 ms, maybe it's not the better one.

Source

 

[Submit][Status]