Worker and Salary 3#10666

Worker and Salary 3

1 second
128 megabytes
Easy

Each worker receives their salary several times during the year. Output the surnames of the workers along with their total salaries at the end of the year, sorted in ascending order by surname.

Input

Each line contains information about a worker: their surname and the salary they received. The same worker may appear in the list multiple times, which means they received their salary multiple times throughout the year.

Output

Print the surnames and the total salaries received by each worker during the entire year, in ascending order by surname. For each surname, output the sum of all salaries they received.

Examples

Example 1

Loading
Loading