#0001B5

z-distance

You are given one number "distance".
You need to find a number that when this distance is subtracted from it, gives a reverse number from the original.
The reverse number is the one where all digits are put in the reverse order, removing leading zeros.
For 123 the reverse is 321
For 100 the reverse is 1 (after removing zeros from 001)

Example:
Given a distance of 9, the result is the number 10.
10 - 9 = 1 (1 is the reverse number of 10).

In case there is no solution, output -1.

InputIn the first line is the distance N between the number and its reversed representation (1<= N<= 1000000)


Output Output the number, that when the distance is subtracted from it,gives the reversed number.In case there is more than one solution, output the smallest number. Output "-1" without quotes if there is no solution.


Input9
Output10


Input729
Output1030


Input990
Output11001


Input1
Output-1

Submit solution

Coming later

The grading service will be connected in a later migration step. You can inspect the task and your previous results now.