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