n=int(input()) l=list(map(int,input().split())) s=[] for i in range(9): s+=[str(i+1)]*l[i] s.sort() s.reverse() print("".join(s))