n = int(input()) c = [int(input()) for _ in range(9)] ans = "" for i in range(9,-1): if c[i] > 0: ans += str(i) * c[i] print(ans)