#include<stdio.h>
struct stu{
long int num;
char name[10];
double score;
}a[2];
int main(){
int i;
for(i=0;i<2;i++)
scanf("%ld,%s,%lf",&a[i].num,&a[i].name,&a[i].score);
if(a[0].score>a[1].score)
printf("分数高的学号和姓名是:%ld,%s \n",a[0].num,a[0].name);
else
printf("分数高的学号和姓名是:%ld,%s \n",a[1].num,a[1].name);
return 0;
}