n = int(input())
a = []
c = list(map(int, input().split()))
for i in range(9):
    a += [str(i + 1)] * c[i]
a.sort(reverse=True)
print("".join(a))