#!/usr/bin/env python
#coding=utf-8
import sys
import os
import math

current_word = None
current_word_value_list = []

#ñ߽
def process_value_list(value_list):
    return str( sum(value_list) )

for line in sys.stdin:
    line = line.strip()
    (word,count) = line.split("\t")
    count = float(count) #ֵҪת

    if current_word == word:#ûб䣬ۼ
        current_word_value_list.append(count)
    else:#ʷ仯,
        if current_word != None:
            #ǵһУ Noneһ,ǵһв
            #һ
            print current_word + "\t" + process_value_list(current_word_value_list)
        #ʼcurrent_wordcurrent_countΪǰ
        current_word = word
        current_word_value_list = []
        current_word_value_list.append(count)

#һдǺǰһеĴʣûдˣǰû
if current_word:
    print current_word + "\t" + process_value_list(current_word_value_list)
