Instead of only the fully qualified path of all accounts (e.g. Expenses:Food:Restaurant), also output (Expenses:Food).