(1) to pay its just proportion of the general costs of the action;
(2) to pay the costs of the reference;
(3) to satisfy and cancel all recorded 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.