시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 2048 MB1241139293.878%

문제

For the last couple of years gaming competitions have been very popular at the TU Delft. During every competition, any player can obtain up to $100$ points. However, the administration of these competitions has been absolutely terrible, because the result of every competition was written down on a piece of paper and all these were scattered across the TU Delft. A group of students has managed to find (almost) all of these lists of scores, but they would like to compute the total score of each participant. Given a list of (possibly duplicate) names and their scores, help the students out by creating a list of the total score of each participant, sorted in alphabetic order.

입력

On the first line an integer $1 \leq n \leq 10^5$. On the next $n$ lines, the name (a string containing no spaces) of person $M$ followed by an integer $1 \leq k \leq 100$, the score of $M$ in any arbitrary competition.

출력

The output consists of $m$ lines, where $m$ is the number of unique names in the input. Give in alphabetic order the names of all participants and their total score, separated by a space.

예제 입력 1

8
Grayson 70
Dante 20
Anton 60
Grayson 73
Grayson 97
Dante 92
Tanisha 56
Grayson 96

예제 출력 1

Anton 60
Dante 112
Grayson 336
Tanisha 56

예제 입력 2

8
Alexus 36
Jaxon 80
Hali 12
Shayna 31
Xavier 46
Xavier 17
Jaxon 15
Alexus 85

예제 출력 2

Alexus 121
Hali 12
Jaxon 95
Shayna 31
Xavier 63