The mortgagee must apply the proceeds of sale as follows—
(a) firstly, to the payment of all costs, charges and expenses properly incurred by the mortgagee for the sale or any attempted sale;
(b) secondly, to payment of charges on the lease, including all debts owing to the State under section 438 ;
(c) thirdly, to payment of any amount owing to a mortgagee or, if more than 1 mortgagee, according to their priorities;
(d) fourthly, if the mortgagee is selling in possession under section 240F , to payment of expenses incurred by the State to rectify any damage caused to the land by the lessee;
(e) lastly, to the lessee.