N=int(input())
C=list(map(int,input().split()))

ANS=""
for i in range(9):
    ANS+=str(i+1)*C[i]

print(ANS[::-1])