#include <stdio.h>
struct SCORE {
int number;
char name[20];
int eigo;
int kokugo;
int sugaku;
int goukei;
};
void input(struct SCORE *p)
{
scanf("%d%19s%d%d%d", &p
->number
, p
->name
, &p
->eigo
, &p
->kokugo
, &p
->sugaku
); p->goukei = p->eigo + p->kokugo + p->sugaku;
}
int main()
{
struct SCORE x1, x2, *p;
input(&x1);
input(&x2);
p = (x1.goukei > x2.goukei) ? &x1 : &x2;
printf("%s %d\n", p
->name
, p
->goukei
); return 0;
}
I2luY2x1ZGUgPHN0ZGlvLmg+CgpzdHJ1Y3QgU0NPUkUgewoJaW50CW51bWJlcjsKCWNoYXIJbmFtZVsyMF07CglpbnQJZWlnbzsKCWludAlrb2t1Z287CglpbnQJc3VnYWt1OwoJaW50CWdvdWtlaTsKfTsKCnZvaWQgaW5wdXQoc3RydWN0IFNDT1JFICpwKQp7CglwcmludGYoIuWtpuexjeeVquWPtyDmsI/lkI0g6Iux6KqeIOWbveiqniDmlbDlraZcbiIpOwoJc2NhbmYoIiVkJTE5cyVkJWQlZCIsICZwLT5udW1iZXIsIHAtPm5hbWUsICZwLT5laWdvLCAmcC0+a29rdWdvLCAmcC0+c3VnYWt1KTsKCXAtPmdvdWtlaSA9IHAtPmVpZ28gKyBwLT5rb2t1Z28gKyBwLT5zdWdha3U7Cn0KCmludCBtYWluKCkKewoJc3RydWN0IFNDT1JFIHgxLCB4MiwgKnA7CgoJaW5wdXQoJngxKTsKCWlucHV0KCZ4Mik7CglwID0gKHgxLmdvdWtlaSA+IHgyLmdvdWtlaSkgPyAmeDEgOiAmeDI7CglwcmludGYoIiVzICVkXG4iLCBwLT5uYW1lLCBwLT5nb3VrZWkpOwoJcmV0dXJuIDA7Cn0K