Employee and Salary 3#264

Employee and Salary 3

1 second
128 megabytes
Easy (≈1000)

The salary of each employee is given. You need to find the sum of the salaries they received over the year. Provide the list of employees in ascending order of their surnames, along with their total received salaries.

Input

The input provides information for each employee in the format surname and salary. The number of employees is unknown. If an employee appears several times in the list, it means that this amount should be added to the employee's total salary.

Output

Output the employees' surnames in ascending order with their total received salaries.

Examples

Example 1

Loading
Loading