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