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