#include<iostream>
#include<cstdio>
#include<cstring>
#include<cmath>
using namespace std;
const int maxn=1010;
struct Betting{
char id[20];
char lin[12];
char lout[12];
}temp,le,ln;
int main()
{
int n;
scanf("%d",&n);
strcpy(le.lin,"24:00:00");
strcpy(ln.lout,"00:00:00");
while(n--){
scanf("%s%s%s",temp.id,temp.lin,temp.lout);
if(strcmp(le.lin,temp.lin)>0) le=temp;
if(strcmp(ln.lout,temp.lout)<0) ln=temp;
}
printf("%s %s\n",le.id,ln.id);
return 0;
}
可以不用结构体,跟那道年龄最大最小题目差不多