Given a sequence of triplets formed by two names and and a natural , that indicate that has paid euros to , print the final balance of each person, first sorted by name, and then sorted by balance.
Input is a non empty sequence of triplets formed each one by two names and a natural. There are not two people with the same name.
Your program must print the final balance of each person, first sorted by name, and then sorted by balance, separated by a line with twenty dashes. In the event of a tie in the balance, it must print first the smallest name.
Input
john mary 1000 peter john 20000 mary anna 1000 emma anna 5000 peter michael 4000 peter paul 0 anna michael 1000
Output
anna 5000 emma -5000 john 19000 mary 0 michael 5000 paul 0 peter -24000 -------------------- peter -24000 emma -5000 mary 0 paul 0 anna 5000 michael 5000 john 19000