import java.util.*; public class Main { public static void main(String[] args) { Scanner sc=new Scanner(System.in); while(sc.hasNext()) { int n=sc.nextInt(); zhigong[] p=new zhigong[n]; zhigong t=new zhigong(); for(int i=0;i<n;i++) { int a=sc.nextInt(); String b=sc.next(); int c=sc.nextInt(); p[i].FZ(a,b,c); } for(int i=1;i<n;i++) { int j=-1; while(j<=i && p[i].age>p[++j].age); if(j<i) { t=p[i]; for(int k=i-1;k>=j;k--) { p[k+1]=p[k]; } p[j]=t; } } for(int i=0;i<3;i++) { p[i].speak(); } } } } class zhigong { int ID; String name; int age; void FZ(int a,String b,int c) { ID=a; name=b; age=c; } void speak() { System.out.println(ID+" "+name+" "+age); } }
程序员大阳
yeyeyy
相关分类