1004 成绩排名
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner in=new Scanner(System.in);
int count=in.nextInt();
String s=in.nextLine();
int score[]=new int[count];
String str[][]=new String[count][3];
for(int i=0;i<count;i++){
String d=in.nextLine();
str[i]=d.split("\\s+");
score[i]=Integer.parseInt(str[i][2]);
}
int max=0,min=0;
for(int j=1;j<count;j++){
if(score[j]>score[max])
max=j;
if(score[j]<score[min])
min=j;
}
System.out.println(str[max][0]+" "+str[max][1]);
System.out.println(str[min][0]+" "+str[min][1]);
}
}