1076: 最大数最小数

Memory Limit:128 MB Time Limit:1.000 S
Judge Style:Text Compare Creator:
Submit:12 Solved:5

Description

输入一个三位数(100-999),将这三位数各位上的数字重新排列得到一个新的三位数(包括001这种假三位数),求这些三位数中最大的三位数和最小的三位数。

Input

123

Output

321

123

Sample Input Copy

102

Sample Output Copy

210
012