student=[]
n=int(input(""))
for i in range(n):
	name=input("")
	score1=float(input(""))
	score2=float(input(""))
	score3=float(input(""))
	student.append([name,score1,score1,score3])
for hs in student:
	name=hs[0]
	score1=hs[1]
	score2=hs[2]
	score3=hs[3]
	avg_score=(score1+score2+score3)/3
	print(f"Diem trung binh cua hoc sinh {name}: {avg_score}")