| 시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
|---|---|---|---|---|---|
| 2 초 | 1024 MB | 103 | 56 | 44 | 55.000% |
Let's call positive integer smooth if each of its digits except the first and the last is less then the average of it's two neighbor digits. It means that if $x = a_n \cdot 10^n + a_{n-1} \cdot 10^{n-1} + ... + a_1 \cdot 10 + a_0$ then for each $i = 1 ... {n-1}$ the inequality $a_i < (a_{i - 1} + a_{i + 1}) / 2$ holds.
Vasya has been studying smooth numbers for a long time and he wants to know, if any smooth number of exactly $l$ digits exists, and if so, what is the greatest $l$-digit smooth number.
Vasya is asking you for help! Find the greatest $l$-digit smooth number.
Input file contains the only integer $l$ ($1 \le l \le 100$) --- number of digits in smooth number.
Output the greatest $l$-digit smooth number or $-1$ if it does not exist.
3
989