The proceeds of every sale, after deducting the costs and expenses of the proceedings, shall be divided among the parties whose rights and interests shall have been sold, in proportion to their respective rights in the premises, and shall be paid to them, their guardians, or legal representatives by the commissioners.