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