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


Submit

Login to submit.

Contributors

Statistics

99% Solution Ratio
rahat_chyEarliest, Dec '20
rahat_chyFastest, 0.0s
rahat_chyLightest, 0 B
bokaifShortest, 1B
Toph uses cookies. By continuing you agree to our Cookie Policy.