The proceeds of the sale of encumbered property must be applied, under the direction of the court, or by the court, as follows:
1. To pay its just proportion of the general costs of the action.
2. To pay the costs of the reference, if any.
3. To satisfy and cancel of record the liens in their order of priority, by payment of the sums due and to become due, the amount due to be verified by affidavit at the time of payment.
4. The residue among the owners of the property sold, according to their respective shares therein.
[1911 CPA § 607; RL § 5549; NCL § 9096] — (NRS A 1985, 772)