#include <iostream>
#include <cstdio>
#include <algorithm>
using namespace std;
struct student{
char name[15],id[15];
int grade;
bool operator <(const student & a) const {
return grade>a.grade;
}
}stu[10001];
int main(int argc, char** argv) {
int n; scanf("%d",&n);
for(int i=0;i<n;i++) scanf("%s %s %d",stu[i].name,stu[i].id,&stu[i].grade);
int grade1,grade2;
scanf("%d %d",&grade1,&grade2);
sort(stu,stu+n);
int count=0;
for(int i=0;i<n;i++){
if(stu[i].grade>=grade1 && stu[i].grade<=grade2) {
printf("%s %s\n",stu[i].name,stu[i].id);
count++;
}
}
if(count==0) printf("NONE");
return 0;
#include <cstdio>
#include <algorithm>
using namespace std;
struct student{
char name[15],id[15];
int grade;
bool operator <(const student & a) const {
return grade>a.grade;
}
}stu[10001];
int main(int argc, char** argv) {
int n; scanf("%d",&n);
for(int i=0;i<n;i++) scanf("%s %s %d",stu[i].name,stu[i].id,&stu[i].grade);
int grade1,grade2;
scanf("%d %d",&grade1,&grade2);
sort(stu,stu+n);
int count=0;
for(int i=0;i<n;i++){
if(stu[i].grade>=grade1 && stu[i].grade<=grade2) {
printf("%s %s\n",stu[i].name,stu[i].id);
count++;
}
}
if(count==0) printf("NONE");
return 0;
}