n = int(input()) c = list(map(int,input().split())) for i in reversed(range(1, 10)): print(str(i)*c[i-1], end="") print()