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