Numbers#3356

Numbers

1 second
64 megabytes
Very hard

Vasya wrote down all the numbers from to in sequence, without any spaces. Then, from each sequence of consecutive identical digits, he kept only one digit. As a result, digits remained. However, Vasya forgot the value of he initially used. Your task is to help him determine .

Input

The input consists of a single integer (1 \le S \le 10^{18}).

Output

The output should be a single integer . If no such number exists, output .

Examples

Example 1

Loading
Loading