10373 - 補考problem2   

Description

The input contains three integers of the same length (same number of digits).
For example,
3412
5232
9128

For each integer, we rearrange its digits from small to large and produce a new integer. Therefore, the three integers above become
1234
2235
1289

The output shows the three integers in an increasing order, that is,
1234
1289
2235


You may use the following piece of code:

/* Using bubble sort to rearrange an array A[n] */

for (i = 0; i < n; i++) {
   for (j = 1; j < n; j++) {
      if (A[j-1] > A[j]) {
         /* swap A[j-1] A[j] */
      }
   }
}

Input

The length of three integers, 1 ≤ length ≤ 9.
Three integers of the same length.

Output

Three rearranged integers in an increasing order.

Print a newline at the end of each integer.

Sample Input  Download

Sample Output  Download

Tags




Discuss