Олимпиадный тренинг

Задача 38779. Food stock


Задача

Темы: Словари
Znayka from the Flower City invented the rocket. One fine day it was decided to fly to the moon. For a successful flight, the rocket must have a certain supply of food. So that any shorty would not be sad during the flight, it was decided to ask everyone his favorite product and the number of packages that he needs for the entire flight. As a result, Znayka had a very large list in his hands, in which the names of the products were repeated with different amounts. Znayka asks you for help. He wants a list of products in lexicographical order, with the total number of packages of each product.

Input
The program receives a list of strings. Each string contains the name of the product, followed by a space followed by the number of packages that shorty indicated. The list ends with the word END!.

Imprint
Print the name of all products in lexicographic order, then, separated by a space, the total number of packages of this product.
 
Examples
# Input Output
1
cookies 10
cookies 5
syrup 9
syrup 8
cookies 1
END!
cookies 16
syrup 17