N=int(input()) C=list(map(int,input().split())) ans="" for i in range(9,0,-1): ans+=str(i)*C[i-1] print(ans)