#arc130c. [arc130_c]Digit Sum Minimization
[arc130_c]Digit Sum Minimization
Problem Statement
Given are positive integers , where none of the digits is .
Permute the digits of each of and so that the sum of the digits in is minimized.
Constraints
- None of the digits of and is .
Input
Input is given from Standard Input in the following format:
Output
After permuting the digits of each of and so that the sum of the digits in is minimized, print in the first line and in the second line.
If multiple solutions exist, printing any of them will be accepted.
Sample Input 1
253
286
Sample Output 1
532
268
We have , whole digits sum to .
Other solutions will also be accepted, such as .
Sample Input 2
345
556
Sample Output 2
435
565
We have , whole digits sum to .
Sample Input 3
123
987987
Sample Output 3
312
799788
We have , whole digits sum to .
Sample Input 4
11111111111111111111
111111111111111111111111111111
Sample Output 4
11111111111111111111
111111111111111111111111111111