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