#include <stdio.h>
int main() {
struct student {
int num;
float score[3];
char name[8];
float average;
}stu[4];
int a, b, c, d;
for (a=0; a<3; a++) {
scanf("%d%s", &stu[a].num, &stu[a].name);
for (b=0; b<3; b++) scanf("%f", &stu[a].score[b]);
}
for (a=0; a<3; a++) {
stu[a].average=0;
stu[a].average=stu[a].score[0]*0.1+stu[a].score[1]*0.2+stu[a].score[2]*0.7;
}
for (a=0; a<3; a++) for (b=1; b<3-a; b++) {
if (stu[a].average<stu[a+b].average) {
stu[4]=stu[a];
stu[a]=stu[a+b];
stu[a+b]=stu[4];
}
}
for (a=0; a<3; a++) printf ("%d %s %.1f\n", stu[a].num, stu[a].name, stu[a].average);