# 首先定义结构体
class stud:
def __init__(self, num, name, score):
self.num = num
self.name = name
self.score = score
self.sum = sum(score)
# 读取输入
N = int(input())
students = []
for _ in range(N):
info = input().split()
num = int(info[0])
name = info[1]
score = list(map(int, info[2:]))
students.append(stud(num, name, score))
# 计算平均分
total_sum = 0
for student in students:
total_sum += student.sum
average = total_sum / N
# 输出每个学生的信息
for student in students:
print(student.num, student.name, *student.score, student.sum)
# 输出平均分
print("总平均分={:.6f}".format(average))
# 输出总分最高的学生信息
highest_score_student = max(students, key=lambda x: x.sum)
print(highest_score_student.num, highest_score_student.name, *highest_score_student.score, highest_score_student.sum)