shohkin = [100, 50, 30,20, 10, 0]
data = []
while w = gets
data << w.split()
end
data = data.zip(shohkin)
.map{|e|e.flatten }
.select{|e|e[-1]}
h={}
data.map { |e|
h[e[1]]||=[0,0]
h[e[1]][0]+=e[2]
h[e[1]][1]+=1
}
h.map { |e| e[1][0]=e[1][0]/1.0/e[1][1] }
h[data[-1][1]]=[0,0] if (data[5] && (data[4][1]==data[5][1]))
data.delete_at(-1)
data.map { |e| printf("%s %g\n",e[0],h[e[1]][0]) }
c2hvaGtpbiA9IFsxMDAsIDUwLCAzMCwyMCwgMTAsIDBdCmRhdGEgPSBbXQp3aGlsZSB3ID0gZ2V0cwogICAgZGF0YSA8PCB3LnNwbGl0KCkKZW5kCmRhdGEgPSBkYXRhLnppcChzaG9oa2luKQoJLm1hcHt8ZXxlLmZsYXR0ZW4gfQoJLnNlbGVjdHt8ZXxlWy0xXX0KaD17fQpkYXRhLm1hcCB7IHxlfAoJaFtlWzFdXXx8PVswLDBdCgloW2VbMV1dWzBdKz1lWzJdCgloW2VbMV1dWzFdKz0xCn0KaC5tYXAgeyB8ZXwgZVsxXVswXT1lWzFdWzBdLzEuMC9lWzFdWzFdIH0KaFtkYXRhWy0xXVsxXV09WzAsMF0gaWYgKGRhdGFbNV0gJiYgKGRhdGFbNF1bMV09PWRhdGFbNV1bMV0pKSAKZGF0YS5kZWxldGVfYXQoLTEpCmRhdGEubWFwIHsgfGV8IHByaW50ZigiJXMgJWdcbiIsZVswXSxoW2VbMV1dWzBdKSB9