Changeling#454

Changeling

1 second
64 megabytes
Very hard

A number is called the reverse of a number if the reversed decimal representation of one matches the decimal representation of the other. For example, the reverse of is , and the reverse of is or, excluding leading zeros, simply . You are given a positive integer . Find the largest integer such that added to its reverse equals the given number .

Input

The first line contains one integer (1 \leq N \leq 10^{100000}).

Output

Print one integer — the answer to the problem. If such does not exist, print 0.

Examples

Example 1

Loading
Loading