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