n=int(input()) a=list(map(int,input().split()))[::-1] ans="" for i in range(9): for j in range(a[i]): ans+=str(9-i) print(ans)