N = int(input()) c1, c2, c3, c4, c5, c6, c7, c8, c9 = map(int, input().split(' ')) a = [] c = [c1, c2, c3, c4, c5, c6, c7, c8, c9] for i in range(9): for k in range(c[i]): a.append(str(i + 1)) a.sort(reverse=True) I = ''.join(a) print(I)