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$
.
The input contains a single integer $N$
($1 \le N \le 1000$
).
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.
Input | Output |
---|---|
100 | 99 |
88, 77, 66... are also acceptable. |
Input | Output |
---|---|
99 | 99 |