input() chk = {} ans = '' for i, j in enumerate(map(int, input().split()), 1): chk[i] = j for i in range(9, 0, -1): if chk[i]: ans += str(i) * chk[i] print(ans)