char name[20];
int a;
int b;
char x;
char y;
int c;
int sum;
};
#include<stdio.h>
int main(){
char a1,a2,a3;//后面输入数据的时候的三个空格。。我不会别的方法,把“Y”“N”,录进去。
int n,i,max,co=0;
struct per p[100];
scanf("%d",&n);
for (i=0; i<n; i++) {
scanf("%s%d%c%d%c%c%c%c%d",&p[i].name,&p[i].a,&a1,&p[i].b,&a2,&p[i].x,&a3,&p[i].y,&p[i].c);
p[i].sum=0;
}
for (i=0; i<n; i++) {
if ((p[i].a>80)&&(p[i].c>0)) {
p[i].sum+=8000;
}
if ((p[i].a>85)&&(p[i].b>80)) {
p[i].sum+=4000;
}
if (p[i].a>90) {
p[i].sum+=2000;
}
if ((p[i].a>85)&&(p[i].y=='Y')) {
p[i].sum+=1000;
}
if ((p[i].b>80)&&(p[i].x=='Y')) {
p[i].sum+=850;
}
}
max=p[0].sum;
for (i=0; i<n; i++) {
if (p[i].sum>max) {
max=p[i].sum;
}
co=co+p[i].sum;
}
for (i=0; i<n; i++) {
if (p[i].sum==max) {
printf("%s",p[i].name);
printf("\n");
printf("%d\n",p[i].sum);
printf("%d\n",co);
break;
}
}
return 0;
}
using namespace std;
struct Student
{
string xingming;
int qimo;
int banji;
char sxue;
char sxibu;
int lunwen;
int jiang;
}a[105];
int main() {
int n;
cin>>n;
int sum=0,max=-100,pos;
for(int i=1;i<=n;i++)
{
cin>>a[i].xingming>>a[i].qimo>>a[i].banji>>a[i].sxue>>a[i].sxibu;
cin>>a[i].lunwen;
if(a[i].qimo>80 && a[i].lunwen>=1)
a[i].jiang+=8000;
if(a[i].qimo>85 && a[i].banji>80)
a[i].jiang+=4000;
if(a[i].qimo>90)
a[i].jiang+=2000;
if(a[i].qimo>85 && a[i].sxibu=='Y')
a[i].jiang+=1000;
if(a[i].banji>80 && a[i].sxue=='Y')
a[i].jiang+=850;
sum+=a[i].jiang;
if(a[i].jiang>max)
{
max=a[i].jiang;
pos=i;
}
}
cout<<a[pos].xingming<<endl<<max<<endl<<sum;
return 0;
}