eolymp
bolt
Try our new interface for solving problems
Problems

Worker and Salary 3

Worker and Salary 3

Time limit 1 second
Memory limit 128 MiB

Each worker got his salary some times in a year. Print surnames of the workers with their final salary at the end of the year in increasing order of surname.

Input data

Each line contains information about worker: surname and his salary. The same employee may appear in the list several times - this means that he received his salary several times.

Output data

Print the surnames and salaries of all employees for the entire year in ascending order of surnames. That is, for each surname, print the total salary that he received during the year.

Examples

Input example #1
Sidorov 100
Mamedov 150
Mamedov 250
Sidorov 110
Ivanov 200
Petrov 120
Sidorov 160
Ivanov 270
Output example #1
Ivanov 470
Mamedov 400
Petrov 120
Sidorov 370
Author Michael Medvedev