Think Inside the Box

Limits 1s, 512 MB · Custom Checker

Babu Bhai is a student of AUST. He has some favorite numbers. His favorite numbers are those number that has only one distinct digit. Example: 7, 88, 222, 9999, etc.

123, 122, 33344 are not his favorite numbers.

Now, given a positive integer $N$, you have to find a positive favorite number for Babu Bhai not greater that $N$.

Input

The input contains a single integer $N$ ($1 \le N \le 1000$).

Output

Print Babu Bhai's favorite number.

If there are multiple possible solutions print any of them. It is guaranteed that for the given $N$ a solution always exists.

Samples

InputOutput
100
99

88, 77, 66... are also acceptable.

InputOutput
99
99