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