Lady Sequence
The lady wrote down a sequence of consecutive positive integers on a piece of paper. The first number in this sequence was . For instance, if and , the sequence would be . While she was at school, her younger sister played with the sequence and removed all but one digit from each number, resulting in a sequence of single digits.
When the lady returned from school, she was upset because she couldn't remember the starting number . Your task is to help her find the smallest possible from which the sequence could have started.
Input
The first line contains a single integer () — the number of numbers in the sequence.
The second line contains digits () — the sequence of digits that the lady found when she returned from school.
Output
Output a single line with the answer — the smallest number from which the lady's sequence could have started.
Examples
Note
For example, results in the sequence , from which the lady's younger sister could have removed digits to create the sequence of digits given in the example. Since no smaller will work, the answer is .
Scoring
( points): , the correct answer does not exceed ;
( points): ;
( points): , all digits in the sequence are the same;
( points): .