#include <iostream>
using namespace std;
#define MAXSIZE 20 //记录最大个数
//学生结构体
typedef struct{
char name[10];
int age;
int no;
}Student;
typedef struct{
Student r[MAXSIZE+1];//data[0]可闲置或作监视哨
int length; //顺序表长度
}SqList;
//创建顺序表
void CreateSqList(SqList &L, int n){
int i;
L.length = n;
for(i=1; i<=L.length; i++){
cin>>L.r[i].no>>L.r[i].age>>L.r[i].name;
}
}
//输出顺序表
void PrintSqList(SqList &L){
int i;
for(i=1; i<=L.length; i++)
cout<<L.r[i].no<<" "<<L.r[i].age<<" "<<L.r[i].name<<endl;
}
//按照学号简单选择排序,Acc=1表示升序,Acc=-1表示降序
void SelectSort(SqList &L,int Acc){
//--------补充代码--Start------
//--------补充代码--End------
}
//主函数
int main(){
int n,Acc;
SqList List,TempList;
int select;
while(cin>>select){
if(select==0)
return 0;
else if(select==1){
cin>>n;
CreateSqList(List, n);
}
if(select==6){
cin>>Acc;
TempList=List;
SelectSort(TempList,Acc);
PrintSqList(TempList);
}
}
return 0;
}