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