#include <bits/stdc++.h>
using namespace std;
map<string,double> m;
int main(){
	int n,i;
	string name;
	double val;
	
	//读入
	cin>>n;
	for(i = 0;i < n;i++){
		cin>>name>>val;
		//如果名字没出现过,也就是第一次出现 
		if(m.count(name) == 0){
			m[name] = val * 0.75;
		}else{
			m[name] = m[name] + val;
		}
	}
	
	//遍历
	for(map<string,double>::iterator j = m.begin();j != m.end();j++){
		cout<<j->first<<" "<<fixed<<setprecision(1)<<j->second<<endl;
	} 
	
}

/**************************************************************
	Problem: 1506
	User: admin
	Language: C++
	Result: Accepted
	Time:18 ms
	Memory:2084 kb
****************************************************************/