For every debit, show txn_id, account_id, amount and the account balance just before it as balance_before (credits − debits of earlier txn ids).
txn_id
account_id
amount
balance_before
Each hint gives a little more help. Try on your own first.
Run your code to see the output here.