A program for calculating debts based on a list of transactions