The Indian mathematician D. R. Kaprekar is known for his works in number theory. One of his works is devoted to the so-called Kaprekar transformation. Consider the following operation. Let the number be given. Let be the largest number that can be obtained from by permuting its digits, and is the smallest number (this number can contain leading zeros). Let's designate as the difference M - m, supplemented if necessary with leading zeros so that the number of digits in it is equal to the number of digits in .
For example, K(100) = 100 - 001 = 099. K(2414) = 4421 - 1244 = 3177.
Kaprekar proved that if we start with some four-digit number , in which not all the digits are equal, and successively apply this operation to it (calculate K(x), K(K(x)), ...), then sooner or later the number will appear. For this number the equality K(6174) = 7641 - 1467 = 6174 is true, therefore, the process will cycle on this number.
Your task is to write a program that calculates by the number .
One integer x~(1 \le x \le 10^9) without leading zeroes.
Print .
Example 1
Example 2