The judgment shall direct a sale of the real estate or other property for the satisfaction of all liens charged thereon, and the manner of such sale, subject to the rights of all persons which are paramount to such liens or any of them. It shall require the officer making such sale to pay over and distribute the proceeds of the sale, after deducting all lawful charges and expenses, to and among the lienors to the amount of their respective claims, if there is sufficient therefor; and if there is not sufficient then to divide and distribute the same among the several lienors in proportion to the amount due to each, and without priority among themselves.
SDCL 44-9-44