N = int(input()) c = list(map(int,input().split())) s = [] for i in range(9): s += [str(i+1)]*c[i] s.sort() s.reverse() print(''.join(s))