#include <stdio.h>
#include <string.h>
struct Student {
char id[11];
char name[31];
int math;
int english;
int programming;
int environment;
int ethics;
int sports;
};
int main() {
int n;
scanf("%d", &n);
struct Student students[10];
for (int i = 0; i < n; i++) {
scanf("%s %s %d %d %d %d %d %d",
students[i].id, students[i].name,
&students[i].math, &students[i].english,
&students[i].programming, &students[i].environment,
&students[i].ethics, &students[i].sports);
}
char targetId[11];
scanf("%s", targetId);
int targetIndex = -1;
for (int i = 0; i < n; i++) {
if (strcmp(students[i].id, targetId) == 0) {
targetIndex = i;
break;
}
}
if (targetIndex != -1) {
struct Student targetStudent = students[targetIndex];
int totalScore = targetStudent.math + targetStudent.english +
targetStudent.programming + targetStudent.environment +
targetStudent.ethics + targetStudent.sports;
float averageScore = (float)totalScore / 6;
printf("%s %d %.2f\n", targetStudent.name, totalScore, averageScore);
}
return 0;
}