N=int(input())
C=list(map(int,input().split()))
ANS=[]
for i in range(8,-1,-1):
  ANS.append(str(i+1)*C[i])
print(''.join(ANS))