#include <iostream>
#include <cstdio>
#include <algorithm>
using namespace std;
struct stu{
string name;
int year;
int month;
int day;
}a[105];
bool cmp(stu a,stu b){
if(a.year < b.year){
return true;
}
if(a.year == b.year){
if(a.month < b.month){
return true;
}else if(a.month == b.month){
if(a.day < b.day){
return true;
}else{
return false;
}
}else{
return false;
}
}else{
return false;
}
}
int main(){
int n;
scanf("%d",&n);
for(int i = 0; i < n; i++){
cin >> a[i].name >> a[i].year >> a[i].month >> a[i].day;
}
sort(a,a+n,cmp);
for(int i = 0; i < n; i++){
cout << a[i].name << "\n";
}
return 0;
}
求各位看看这里哪有问题,(潜在BUG)