n = int(input()) A = list(map(int, input().split())) ans = '' for i in range(8, -1, -1): ans += str(i + 1) * A[i] print(ans)