You are able to construct certain digits from to using a given number of matches for each digit. Your task is to create the largest possible number using at most matches.
For example, if the digit requires matches, requires matches, and requires matches, then using matches, the largest number you can form is .
The first line contains the integers and (1 \le n \le 50, 0 \le k \le 9).
The second line contains k+1 integers from to —the number of matches required to construct the digits from to , respectively.
It is guaranteed that with matches, you can construct at least one digit.
Print the largest number that can be constructed. Leading zeros are not allowed in the output.
You may use fewer than matches if needed.
Example 1