Ordered numbers
Misha has a developed aesthetic feeling. He believes that not all numbers are equally ordered. When he is sad, he begins to invent numbers and put them in order.
Misha likes to consider the sum of digits of a number. In order to put in order a number a, he first writes the number itself. Then he writes the sum of the digits of this number. Then the sum of digits of the sum of digits, and so on, until the next number becomes one-digit number. He believes that the result of putting the number a in order is the sum of all the numbers written out, including the number a itself.
Misha loves this process so much that he even replaces his sheep count with it when he cannot sleep for a long time. He remembers that last night, when he put the number a in order in his mind, he got the number b. But the trouble is - he doesn't remember which number a he took! Help him to find this number.
Input
One positive integer b (1 ≤ b ≤ 10^9
).
Output
If there exists such number a, that after putting it in order, it becomes b, then output any such number. If Misha somewhere was mistaken in the calculations and such number does not exist, print -1.