Square of difference
Execution time limit is 1 second
Runtime memory usage limit is 128 megabytes
Given positive integer . Find and print the square of difference between the maximum and minimum numbers, composed from the digits of number .
For example, if given number is , the maximum number, composed from its digits, is , and minimum number is (the minimum is , but leading zeros are not counted). The required square of difference is .
Input
One positive integer .
Output
Print the required square of difference.
Examples
Input #1
Answer #1
Submissions 3K
Acceptance rate 64%