#include <stdio.h>
typedef struct{
float a, b, c;
}results;
typedef struct{
int id;
char name[20];
results res;
}students;
void input(students arr[], int n){
for(int i = 0; i < n; i++){
scanf("%d%s%f%f%f", &arr[i].id, arr[i].name, &arr[i].res.a, &arr[i].res.b, &arr[i].res.c);
}
}
void output(students arr[], int n){
float a, b, c = a = b = 0;
for(int i = 0; i < n; i++){
a += arr[i].res.a;
b += arr[i].res.b;
c += arr[i].res.c;
printf("%d %s %.2f\n", arr[i].id, arr[i].name, (arr[i].res.a + arr[i].res.b + arr[i].res.c) / 3);
}
printf("%.2f %.2f %.2f", a/n, b/n, c/n);
}
int main()
{
int n;
scanf("%d", &n);
students arr[n];
input(arr, n);
output(arr, n);
return 0;
}