semeru/Code-Code-CloneDetection-POJ104 huggingface dataset:
struct stu
	{
	char num[30];
	char name[30];
	char sex;
	int age;
	float score;
	char add[30];
	struct stu *next;
	};
	struct stu *p1,*p2,*head;
int main()
{
	void result(struct stu*);

	p1=p2=(struct stu*) malloc(sizeof(struct stu));
	scanf("%s ",p1->num);
	scanf("%s ",p1->name);
	scanf("%c",&(p1->sex));
	scanf("%d",&(p1->age));
	scanf("%g",&(p1->score));
	scanf("%s",p1->add);
	head=p1;head->next=0;
	for(;;)
	{
		
	 p1=(struct stu*) malloc(sizeof(struct stu));
     p2->next=p1;
	scanf("%s",p1->num);
	if(p1->num[0]=='e'&&p1->num[1]=='n'&&p1->num[2]=='d')
	{p2->next=0;goto print;}
	scanf("%s ",p1->name);
	scanf("%c",&(p1->sex));
	scanf("%d",&(p1->age));
	scanf("%g",&(p1->score));
	scanf("%s",p1->add);
    p2=p1;
	}
    print:result(head);
	return 0;
}
void result(struct stu *x)
{
	if(x->next==0) 
	{printf("%s ",x->num);
	printf("%s ",x->name);
	printf("%c",x->sex);
	printf(" %d",x->age);
	printf(" %g",x->score);
	printf(" %s",x->add);
	printf("\n");
	}
	else 
	{
	result(x->next);
    printf("%s ",x->num);
	printf("%s ",x->name);
	printf("%c",x->sex);
	printf(" %d",x->age);
	printf(" %g",x->score);
	printf(" %s",x->add);}
	printf("\n");
}
main()
{
char a[2000][20],b[2000][20],c[2000][20],d[2000][20],e[2000][20],s[2000][20];
int i=0,j;
scanf("%s",a[i]);
while(1)
{
scanf("%s",b[i]);
scanf("%s",c[i]);
scanf("%s",e[i]);
scanf("%s",s[i]);
scanf("%s",d[i]);
i++;
scanf("%s",a[i]);
if(a[i][0]=='e')
break;
}
for(j=i-1;j>=0;j--)
{
printf("%s %s %s %s %s %s\n",a[j],b[j],c[j],e[j],s[j],d[j]);
}
}
int main()
{
	struct student
	{
		char imfor[100];
	};

	int n=1,m;
	struct student *p1,*p3[600];
	p1=p3[0]=(struct student *)malloc(sizeof(struct student));
	gets(p1->imfor);
	while (p1->imfor[0]!='e')
	{
		p1=(struct student * )malloc(sizeof(struct student));
		p3[n]=p1;
		n++;
		gets(p1->imfor);
	}
	for (m=n-2;m>=0;m--)
	{
		printf("%s\n",p3[m]->imfor);
	}
}
struct student{
		struct student *pre;
		char s[100];
		struct student *next;
	};

struct student *creat()
{
	struct student *p1,*p2;
    p1=(struct student*)malloc(len);
	gets(p1->s);
	p1->pre=NULL;
	p1->next=NULL;

	p2=p1;
	while(strcmp(p1->s,"end"))
	{
	p1=(struct student*)malloc(len);
	gets(p1->s);
	p1->pre=p2;
	p2->next=p1;
	p1->next=NULL;
	p2=p1;
	}
	return(p1->pre);
}

void print(struct student *end)
{
	while(end)
	{
	puts(end->s);
	end=end->pre;
	}
}




void main()
{
	struct student *end;
	end=creat();
	print(end);
}
struct student
{
	char stu[100];
	struct student *next;
};
int n;

struct student *creat(void)
{
	struct student *head,*p1,*p2,*toil;
	n=0;
	head=NULL;
	p1=p2=(struct student*)malloc(LEN);
	gets(p1->stu);
	while(strcmp(p1->stu,"end")!=0)
	{
		n=n+1;
		if(n==1)head=p1;
		else p1->next=p2;
		p2=p1;
		p1=(struct student*)malloc(LEN);
		gets(p1->stu);
	}
	toil=p2;
	head->next=NULL;
	return(toil);
}

void print(struct student *toil)
{
	struct student *p;
	p=toil;
	if(toil!=NULL)
		do
		{
			printf("%s\n",p->stu);
			p=p->next;
		}while(p!=NULL);
}

void main()
{
	struct student *head;
	head=creat();
	print(head);
}
void main()
{
	char a[200];
    gets(a);
    if(a[0]-'e'||a[1]-'n'||a[2]-'d')
	{
		main();
		puts(a);
	}	
}
struct student 
{
	char ID[20];
	char name[20];
	char sex;
	int age;
	char score[20];
	char address[20];
	struct student *next;
};
struct student *create()
{
	struct student *head,*p1,*p2;
	p1=(struct student*)malloc(LEN);
	scanf("%s",p1->ID);
	if(strcmp(p1->ID,"end")==0){free(p1);head=NULL;}
	else
	{
		head=p1;
		scanf("%s %c %d %s %s",p1->name,&p1->sex,&p1->age,p1->score,p1->address);
		p1->next=NULL;
		p2=p1;
	do
	{
		p1=(struct student*)malloc(LEN);
		p1->next=NULL;
		scanf("%s",p1->ID);
		if(strcmp(p1->ID,"end")==0){p2->next=NULL;free(p1);break;}
		else
		{
			scanf("%s %c %d %s %s",p1->name,&p1->sex,&p1->age,p1->score,p1->address);
			p2->next=p1;
			p1->next=NULL;
			p2=p1;
		}
	}while(1);
	}
	return(head);	
}
void print(struct student *list)
{
	if(list==NULL)return;
	else if(list->next==NULL)
		printf("%s %s %c %d %s %s\n",list->ID,list->name,list->sex,list->age,list->score,list->address);
	else
	{
		print(list->next);
		printf("%s %s %c %d %s %s\n",list->ID,list->name,list->sex,list->age,list->score,list->address);
	}
}
int main()
{
	
	struct student *head;
	head=create();
	print(head);
}
struct student
{
	
/*char id[20];
	
char name[10];
	
char sex;
	
int age;
	
int score;
	
char addr[20];*/
	char s[100];
	
struct student *next;
};
int n;
struct student *creat(void)
{
	
struct student *head;
	
struct student *p1,*p2;
	
n=0;
	
p1=p2=(struct student *)malloc(LEN);
	
//scanf("%s",p1->id);
gets(p1->s);
	
/*while(p1->s!="end")*/
while(strcmp(p1->s,"end")!=0)
	
{
//printf(p1->s);	
//scanf("%s %c %d %d %s",p1->name,&p1->sex,&p1->age,&p1->score,p1->addr);
	
n++;
	
	
if(n==1) p1->next=NULL;
	
	
else p1->next=p2;
	
	
p2=p1;
	
	
p1=(struct student *)malloc(LEN);
	
	
//scanf("%s",p1->id);
gets(p1->s);
	
}
//printf(p1->s);	
head=p2;
	//printf(p2->s);
	
return(head);
}
void print(struct student *head)
{
	
struct student *p;
	
p=head;
//printf(p->s);
	
if(head!=NULL)
	
	
do
	
	
{
	
	
	
//printf("%s %s %c %d %d %s",p->id,p->name,p->sex,p->age,p->score,p->addr);
	if (p->next != NULL)
	{
		printf(p->s);
		printf("\n");
	}
	else
		printf(p->s);
	
	
	
p=p->next;
	
	
}while(p!=NULL);
}
void main()
{
	
struct student*head;
	
head=creat();
	
print(head);
}
struct Student
{
    struct Student *previous;
	char no[20];
    char name[30];
	char sex;
	int age;
	float score;
	char address[30];
};


struct Student *creat()
{
	struct Student *end,*p1,*p2;
	p1=NULL;
    for(;;)
	{
		p2=p1;
		p1=(struct Student*)malloc(LEN);
	    p1->previous=p2;
		scanf("%s",p1->no);
		if(strcmp(p1->no,"end")==0)break;
		else
		{
			scanf("%s",p1->name);
		    getchar();
    	    p1->sex=getchar();
    	    scanf("%d%f",&p1->age,&p1->score);
    	    scanf("%s",p1->address);
		}
	}
	end=p2;
	return(end);
}

void print(struct Student *end)
{
	struct Student *p;
	p=end;
	do
	{
		printf("%s %s %c %d %g %s\n",p->no,p->name,p->sex,p->age,p->score,p->address);
		p=p->previous;
	}while(p!=NULL);
}


void main()
{
	struct Student *end;
	end=creat();
	print(end);
}
struct student
{
	char a[100];
	struct student *pre;
};
struct student *creat()
{
	struct student *p1;struct student *p2;
	struct student *head;
	head=(struct student *) malloc(sizeof(struct student));
	p1=p2=head;
	head->pre=0;
	while(1)
	{
		p1=(struct student *)malloc(sizeof(struct student));
		p1->pre=p2;
		gets(p1->a);
		if(p1->a[0]=='e')
		{
			return (p2);
		}
		p2=p1;
	}
}
int main()
{
	struct student *p1;
	p1=creat();
	while(p1->pre!=0)
	{
		printf("%s\n",p1->a);
		p1=p1->pre;
	}
	return 0;
}
//?????????????????
struct seqs//????
{
    char num[10];
	char name[20];
    char sex;
	int age;
	float score;//???????
	char addr[100];
	struct seqs *next;
};

struct seqs *build()//????
{
    struct seqs *head,*newnode,*p;

	newnode=(struct seqs *)malloc(len);  newnode->next=NULL;//????????	
    scanf("%s %s %c %d %f %s",newnode->num,newnode->name,&newnode->sex,&newnode->age,&newnode->score,newnode->addr);//????????????
	p=newnode;//???p?????????

    while(1)//???????????????????
	{
        newnode=(struct seqs *)malloc(len);//?????
		scanf("%s",newnode->num);
		if(newnode->num[0]=='e')
			break;//???????????
        scanf("%s %c %d %f %s",newnode->name,&newnode->sex,&newnode->age,&newnode->score,newnode->addr);//????
		newnode->next=p;//??????????
		p=newnode;//???p??????
	}
	head=p;//??head
	return head;
}

void main()
{
	int i;
	struct seqs *p;
	p=build();
	while(p!=NULL)
	{
        printf("%s %s %c %d %g %s\n",p->num,p->name,p->sex,p->age,p->score,p->addr);
		p=p->next;
	}
}
int main(){
	struct {
		char No[100];
		char name[20];
		char sex;
		int age;
		float grade;
		char address[20];
	} stu[10000];
	int i;
	cin>>stu[0].No>>stu[0].name>>stu[0].sex>>stu[0].age>>stu[0].grade>>stu[0].address;  //???????
	for(i=1;stu[i-1].No[0]!='e';i++){
		cin>>stu[i].No;
		if(stu[i].No[0]!='e')  //????end?????
            cin>>stu[i].name>>stu[i].sex>>stu[i].age>>stu[i].grade>>stu[i].address;
	}
	for(i=i-2;i>=0;i--)  //????
		cout<<stu[i].No<<" "<<stu[i].name<<" "<<stu[i].sex<<" "<<stu[i].age<<" "<<stu[i].grade<<" "<<stu[i].address<<endl;
	return 0;
}
struct student
{
	char num[200];
	char name[100];
	char xingbie;
	int age;
	char score[200];
	char add[200];
	struct student *next;
};
struct student*creat()
{
	struct student *p1,*head;
	p1=(struct student*)malloc(LEN);
	head=NULL;
	scanf("%s",p1->num);
		if(strcmp(p1->num,"end")==0) return head;
	scanf("%s %c %d %s %s",p1->name,&p1->xingbie,&p1->age,p1->score,p1->add);
	while(1)
	{
		p1->next=head;
		head=p1;
		p1=(struct student*)malloc(LEN);
		scanf("%s",p1->num);
		if(strcmp(p1->num,"end")==0)
			break;
		else
			scanf("%s %c %d %s %s",p1->name,&p1->xingbie,&p1->age,p1->score,p1->add);	
	}
	return (head);
}
void main()
{
	struct student *p;
	p=creat();
	while(p!=NULL) 
	{
		if((strcmp(p->num,"end")==0)){p=p->next;continue;}
		printf("%s %s %c %d %s %s\n",p->num,p->name,p->xingbie,p->age,p->score,p->add);
		p=p->next;
	}; 
}
struct stu
{
	char num[1000];
	struct stu *pre;
}*phead,*p1,*p2,*pend;
void print(void)
{
	struct stu *p;
	for(p=pend;p!=phead;)
	{
		puts(p->num);
		p=p->pre;
	}
	puts(p->num);
}

main()
{
	for(p1=p2=phead=(struct stu*)malloc(sizeof(struct stu));;)
	{
		gets(p1->num);
		if(p1->num[0]=='e')
		{
			pend=p1->pre;
			break;
		}
		p1=(struct stu*)malloc(sizeof(struct stu));
		p1->pre=p2;
		p2=p1;
	}
	print();
}
struct student
{
	char number[20];
	char name[20];
	char sex[2];
	int year;
	float score;
	char address[100];
	struct student *next;
};
int main()
{
	struct student *p1,*p2;
	p1=(struct student *)malloc(sizeof(struct student));
	p1->next=NULL;
	scanf("%s",p1->number);
	while(p1->number[0]!='e')
	{
		scanf("%s%s%d%f%s",p1->name,p1->sex,&p1->year,&p1->score,p1->address);
		p2=p1;
		p1=(struct student *)malloc(sizeof(struct student));
		p1->next=p2;
		scanf("%s",p1->number);
	}
	while(p2!=NULL)
	{
		printf("%s %s %s %d %g %s\n",p2->number,p2->name,p2->sex,p2->year,p2->score,p2->address);
		p2=p2->next;
	}
	return 0;
}
struct Student
	{
		char num[10];
		char nam[20];
		char sex[2];
		char age[3];
		char sco[6];
		char add[12];
		struct Student*next;
	};
int n;
struct Student*creat(void)
{
	struct Student*head;
	struct Student*p;
	p=(struct Student*)malloc(LEN);
	head=NULL;n=0;
	scanf("%s",p->num);
	while(strcmp(p->num,"end")!=0)
	{
		n=n+1;
		scanf("%s%s%s%s%s",p->nam,p->sex,p->age,p->sco,p->add);
		if(n==1)head=p;
		else
		{
			p->next=head;
			head=p;
		}
		p=(struct Student*)malloc(LEN);
		scanf("%s",p->num);
	}
	
	return(head);
}
int main()
{
	struct Student*pt;
	pt=creat();
	while(pt!=NULL)
	{
		printf("%s %s %s %s %s %s\n",pt->num,pt->nam,pt->sex,pt->age,pt->sco,pt->add);
		pt=pt->next;
	}
	return 0;
}
struct student
{char number[100];
char name[100];
char sex;
int age;
char score[20];
char address[100];
struct student *nest;
struct student *front;
}; 
void main()
{
	struct student *p1,*p2;
	int n=0;
	p1=p2=(struct student*)malloc(LEN);
	p1->front=NULL;
	scanf("%s",&p1->number);
	while(p1->number[0]!='e'||p1->number[1]!='n'||p1->number[2]!='d')
	{
        scanf("%s %c%d%s%s",&p1->name,&p1->sex,&p1->age,&p1->score,&p1->address);
		n=n+1;
		p2->nest=p1;
		p2=p1;
		p1=(struct student*)malloc(LEN);
		p1->front=p2;
		scanf("%s",&p1->number);
	}
	p2->nest=NULL;
	while(p2!=NULL)
	{
		printf("%s %s %c %d %s %s\n",p2->number,p2->name,p2->sex,p2->age,p2->score,p2->address);
		p2=p2->front;
	}
}
struct student{
	char num[20],name[20],add[100],sex[2];
	int age;
	float score;
	struct student *next;
};
void main()
{
	struct student *p1,*p,*p2;
	p=(struct student*)malloc(sizeof(struct student));
	p->next=NULL;
	scanf("%s",p->num);
	while(p->num[0]!='e')
	{
		scanf("%s%s%d%f%s",p->name,p->sex,&p->age,&p->score,p->add);
		p1=p;
		p=(struct student*)malloc(sizeof(struct student));
		p->next=p1;
	    scanf("%s",p->num);
	}
	p2=p1;
	while(p2!=NULL)
	{
		printf("%s %s %s %d %g %s\n",p2->num,p2->name,p2->sex,p2->age,p2->score,p2->add);
		p2=p2->next;
	}
	
}
struct student
{
	char str[100];
	struct student *next;
};
struct student *creat(void)
{
	struct student *head,*p1,*p2;
	p1=(struct student*)malloc(len);
    gets(p1->str);
	if(strcmp(p1->str,"end")==0)
	{
		free(p1);
		head=NULL;
		return head;
	}
	else
	{
    	p1->next=NULL;
		head=p1;
		p2=p1;
		do
		{
			p1=(struct student*)malloc(len);
			gets(p1->str);
			if(strcmp(p1->str,"end")==0)
			{
				free(p1);
				break;
			}
			else
			{
		    	p1->next=NULL;
				p1->next=p2;
				p2=p1;
				head=p1;
			}
		}
		while(1);
		return head;
	}
}
int main()
{
	struct student *p,*pa;
	pa=creat();
	p=pa;
	do
	{
		printf("%s\n",p->str);
		p=p->next;
	}
	while(p!=NULL);
	return 0;
}
struct student
{
char all[100];
struct student *next;
};


struct student *creat(void)
{
struct student *head;
struct student *p,*q;
int t=0;
	
head=(struct student*) malloc (sizeof (struct student));
gets(head->all);
q=head;
head->next=NULL;

do 
{
	if(t>0)
		{
		p->next=q;
		q=p;
		}

p=(struct student*) malloc (sizeof (struct student));
gets(p->all);
t++;
}while(strcmp(p->all,"end")!=0);

return(q);

}

void print(struct student *head)
{
struct student *p;
p=head;

do 
{
printf("%s\n",p->all);
p=p->next;
}while (p!=NULL);

}

void main()
{
struct student *headnew;

headnew=creat();

print(headnew);

}
struct student
{
    char a[10];
	char b[20];
	char c;
	int d;
    float e;
	char f[19];
	struct student * next;
};
int main()
{
	struct student *p1,*p2;
    p1=(struct student *)malloc(len);
	scanf("%s %s %c %d %f %s",p1->a,p1->b,&p1->c,&p1->d,&p1->e,p1->f);
	p1->next=NULL;
	p2=p1;
	while(1)
	{   
		p1=(struct student *)malloc(len);
		scanf("%s",p1->a);
		if(strcmp(p1->a,"end")==0)
			break;
        scanf("%s %c %d %f %s",p1->b,&p1->c,&p1->d,&p1->e,p1->f);
		p1->next=p2;
		p2=p1;
	}
	p1=p2;
	while(p1!=NULL)
	{
		printf("%s %s %c %d %g %s\n",p1->a,p1->b,p1->c,p1->d,p1->e,p1->f);
		p1=p1->next;
	}
	return 0;
}
typedef struct  node
{
    char s[100];
    struct node *next;
}node;
int main()
{
   node *p1,*p2,*head;
   head=(node*)malloc(sizeof(node));
   p1=head;
   p2=head;
   int i=0;
   while(1)
   {
       p2=(node*)malloc(sizeof(node));
       if(i==0)
        p2->next=NULL;
       else
        p2->next=p1;
       p1=p2;
       gets(p2->s);
       if(strcmp(p2->s,"end")==0)
       break;
       head->next=p2;
       i=1;
   }
   p1=head->next;
   while(p1!=NULL)
   {
       printf("%s\n",p1->s);
       p1=p1->next;
   }

    return 0;
}
struct student
{
	char num[1000];
	struct student *next;
};
int n=0;
struct student *creat()
{
	struct student *head,*p1,*p2;
	p1=p2=(struct student*)malloc(LEN);
	gets(p1->num);
	while (strcmp(p1->num,"end")!=0)                                 
	{
		n=n+1;
		if (n==1) head=p1;                         
		else p2->next=p1;
		p2=p1;
		p1=(struct student*)malloc(LEN);
        gets(p1->num);
	}
	p2->next=NULL;
	return (head);
}
struct student *reverse(struct student *head)
{
	struct student *s,*s1;
	s=head;
	head=NULL;
	while(s)
	{
		s1=s;
		s=s->next;
		s1->next=head;
		head=s1;
	}
	return (head);
}
void print (struct student *head)
{
	struct student *p;
	p=head;
	while (p!=NULL)
		{
			printf("%s\n",p->num);
			p=p->next;
		}
}
void main ()
{
	struct student *head;
	head=creat();
	head=reverse(head);
	print(head);
}
int n;
struct stu
{char num[10];
 char name[20];
 char sex;
 int age;
 float score;
 char add[30];
 struct stu *next;
};
struct stu *create() 
{
 struct stu *head, *p1,*p2;
 n=1;
 p1=(struct stu *)malloc(LEN);
 scanf("%s %s %c %d %f %s", &p1->num,&p1->name,&p1->sex,&p1->age,&p1->score,&p1->add); 
 p1->next=NULL;
 head = p1; 
 p2 = p1;
  do
  {
  	p1=(struct stu *)malloc(LEN);
    scanf("%s", &p1->num); 
    if (strcmp(p1->num,"end")==0) 
     {free(p1);break;}
    else 
	{
  	 scanf(" %s %c %d %f %s",&p1->name,&p1->sex,&p1->age,&p1->score,&p1->add); 
	 p1->next=NULL;	
	 p2->next = p1; 
	 p2 = p1;
	 n++;
    }
  }while (1);
  return head;
}
struct stu *del(struct stu *head)
{
    struct stu *p, *ppre;
	p=head;
	while (p&&p->next!=NULL) 
	{ ppre = p; p=p->next;}
	printf("%s %s %c %d %g %s\n", p->num,p->name,p->sex,p->age,p->score,p->add);
	ppre->next=NULL;
	free(p);
	return head;	
}
void main()
{
	struct stu *head;
	int i;
	head=create();
	for(i=0;i<n;i++)
	  head=del(head);
}
struct node
{
	struct node *last;
	char id[15];
	char name[25];
	char sex;
	int age;
	char score[10];
	char addr[15];
	struct node *next;
};
int n=1;

struct node *newnode()
{
	struct node *head=NULL,*New,*This;
	do
	{
		New=(struct node *)malloc(sizeof(struct node));
		scanf("%s",New->id);
		if(n==1)
		{
			head=New;
			New->last=NULL;
			This=head;
		}
		else
		{
			This->next=New;
			New->last=This;
		}
		if(strcmp(New->id,"end")!=0)
		{
			scanf("%s %c %d %s %s",New->name,&New->sex,&New->age,New->score,New->addr);
			This=New;
			n++;
		}
	}while(strcmp(New->id,"end")!=0);
	This->next=NULL;
	return(This);
}
void main()
{
	struct node *p;
	p=newnode();
	do
	{
		printf("%s %s %c %d %s %s\n",p->id,p->name,p->sex,p->age,p->score,p->addr);
		p=p->last;
	}while(p->last!=NULL);
	printf("%s %s %c %d %s %s\n",p->id,p->name,p->sex,p->age,p->score,p->addr);
}
struct Student
{
	char num[20];
	char name[20];
	char sex;
	int age;
	char score[20];
	char add[20];
	struct Student *next;
};
struct Student *creat()
{
	int i;
	struct Student *head,*p1,*p2;
	p1=(struct Student *)malloc(LEN);
	scanf("%s",p1->num);
	for(i=0;p1->num[0]!='e';i++)
	{
		head=p1;
		scanf("%s %c %d %s %s",p1->name,&p1->sex,&p1->age,p1->score,p1->add);
		if(i==0) p1->next=NULL;
		else p1->next=p2;
		p2=p1;
		p1=(struct Student *)malloc(LEN);
		scanf("%s",p1->num);
	}
	return head;
}

int main()
{
	struct Student *head,*p;
	head=creat();
	p=head;
	while(p!=NULL)
	{
		printf("%s %s %c %d %s %s\n",p->num,p->name,p->sex,p->age,p->score,p->add);
		p=p->next;
	}
	return 0;
}
//#define LEN sizeof(struct student)
struct student
	{
		char num[50];
		struct student * next;
	};
int n;
char end[4]="end";

struct student * creat(void)
{
	struct student * p1,*p2;
	n=0;
	p1=p2=(struct student*)malloc(sizeof(struct student));//
	gets(p1->num);
	while(strcmp(end,p1->num)!=0)//
	{
		n=n+1;
		if(n==1)
			p2->next=NULL;
		else p1->next=p2;
		p2=p1;
		p1=(struct student *)malloc(sizeof(struct student));
		gets(p1->num);

	}

	
	return(p2);
	

}

void print(struct student * p2)
{
	struct student *p;
	p=p2;
		do{
			printf("%s\n",p->num);
			p=p->next;
		}while(p!=NULL);
}

int main()
{
	print(creat());
	return 0;
}
struct student
	{
		char num[100];
		struct student *next;
	};
	int n;

	struct student *creat(void)
	{
		struct student *head;
		struct student *p1,*p2;
		n=0;
		p1=p2=(struct student*)malloc(LEN);
		gets(p1->num);
		head=NULL;
		while(strcmp(p1->num,"end"))
		{
			n++;
			p1->next=head;
			head=p1;
			p1=(struct student*)malloc(LEN);
gets(p1->num);
		}
		p1->next=NULL;
		return(head);
	}

	void print(struct student *head)
	{
		struct student *p;
		p=head;
		if(head)
			do
			{
				puts(p->num);
				p=p->next;
			}
			while(p);
	}

	void main()
	{
		struct student *head;
		head=creat();
		print(head);
	}
struct student{
	char num[10];
	char name[20];
	char gd;
	int age;
	float sc;
	char adr[10];
	struct student *next;
};

struct student *append()
{
	struct student *head,*p1,*p2=NULL;
	while(1)
	{
	 p1=(struct student*)malloc(sizeof(struct student));
     scanf("%s",p1->num);
     if (p1->num[0]=='e')
	 {
		head=p2;
		break;
      }
	 else
	 {
	   scanf("%s %c %d%f %s",p1->name,&p1->gd,&p1->age,&p1->sc,p1->adr);
       p1->next=p2;
	   p2=p1;
	 }
	}
    return head;
}


void main()
{
	struct student *p;
	p=append();
	for(;p!=NULL;p=p->next)
	{
		printf("%s %s %c %d %g %s\n",p->num,p->name,p->gd,p->age,p->sc,p->adr);
	}
}
struct student
{
	char num[10];
	char name[20];
	char c;
	int age;
	char score[10];
	char addr[20];
	struct student*next;
};

void main()
{
	struct student *p1,*p2,*p,*head;

	p1=(struct student*)malloc(LEN);
	scanf("%s %s %c %d %s %s",p1->num,p1->name,&p1->c,&p1->age,p1->score,p1->addr);
	p1->next=NULL;
	do
	{
		p2=(struct student*)malloc(LEN);
		scanf("%s",p2->num);
		if(strcmp(p2->num,"end")==0)
		{
			head=p1;
			break;
		}
		else
		{
		scanf("%s %c %d%s%s",p2->name,&p2->c,&p2->age,p2->score,p2->addr);
		p2->next=p1;
		p1=p2;
		}
	}while(strcmp(p2->num,"end")!=0);

	p=head;
	do
	{
		if(p->next==NULL)
			break;
		printf("%s %s %c %d %s %s\n",p->num,p->name,p->c,p->age,p->score,p->addr);
		if(p->next!=NULL)
			p=p->next;
	}while(p->next!=NULL);
	printf("%s %s %c %d %s %s\n",p->num,p->name,p->c,p->age,p->score,p->addr);

}
struct student
{
	char number[20];
	char name[20];
	char c;
	int age;
	float score;
	char address[30];
	struct student *next;
};
int n;
  struct student *creat(void)
  {
	  struct student *head;
	  struct student *p1,*p2;
	  int m;
	  n=0;
	  p1=p2=(struct student*)malloc(LEN);
	  head=NULL;
	  scanf("%s",p1->number);
	  for(m=0;;m++)
	  {
	  if(strcmp(p1->number,"end")!=0)
	  {
	    scanf("%s %c %d %f %s",p1->name,&p1->c,&p1->age,&p1->score,p1->address);
		  n=n+1;
		  if(n==1)head=p1;
		  else p2->next=p1;
		  p2=p1;
		  p1=(struct student *)malloc(LEN);
	  }
	  else break;
	  scanf("%s",p1->number);
	  }
	  p2->next=NULL;
	  return(head);
  }
  struct student *del(struct student *head,char *str)
  { 
	  struct student *p1,*p2;
	  p1=head;
	  while(strcmp(str,p1->number)!=0&&p1->next!=NULL)
	  {
		  p2=p1;
		  p1=p1->next;
	  }
	  if(strcmp(str,p1->number)==0)
	  {
		  if(p1==head)head=p1->next;
		  else p2->next=p1->next;
		  n=n-1;
	  }
	  return(head);
	  
  }
  void main()
  {
	  struct student *head,*p1;
	  head=creat();
	       
		   while(head!=NULL)
		   {
			   p1=head;
			   while(p1->next!=NULL)
				   p1=p1->next;
			   printf("%s %s %c %d %g %s\n",p1->number,p1->name,p1->c,p1->age,p1->score,p1->address);
			   head=del(head,p1->number);
		   }
  }
struct student
{
    char name[32],sex,address[32],id[10],score[10];
    int age;
    struct student *next;
};
struct student *create()
{
    struct student *head=NULL,*p1,*p2;
    char ch[10];
    p1=p2=(struct student*)malloc(Len);
    scanf("%s %s %c %d %s %s",p1->id,p1->name,&p1->sex,&p1->age,p1->score,p1->address);
    p1->next=NULL;
    head=p1;
    p2=p1;
    do
    {
        scanf("%s",ch);
        if(strcmp(ch,"end")==0) break;
     else
      {     p1=(struct student*)malloc(Len);
            strcpy(p1->id,ch);
            scanf("%s %c %d %s %s",p1->name,&p1->sex,&p1->age,p1->score,p1->address);
            p1->next=NULL;
            p2->next=p1;
            p2=p1;
      }
    }while(1);
         return head;
}
   void print(struct student *head)
   {
       struct student *p1,*p2;
    while(p1)
    {
       p1=head;
       if(p1->next==NULL)
       {
            printf("%s %s %c %d %s %s",p1->id,p1->name,p1->sex,p1->age,p1->score,p1->address);
            break;
       }
        else
        {
            while(p1->next!=NULL)
          {
             p2=p1;
             p1=p1->next;
          }
           printf("%s %s %c %d %s %s\n",p1->id,p1->name,p1->sex,p1->age,p1->score,p1->address);
           p2->next=NULL;
           free(p1);
        }
    }
  }
  int main()
  {
      struct student *head;
      head=create();
      print(head);
  }
main()
{
	struct student
	{
		char num[100];
		char name[100];
		char sex[10];
		char age[10];
		char score[10];
		char address[100];
		struct student *next;
	};
	struct student *head,*p1;
	p1=(struct student*)malloc(sizeof(struct student));
	head=NULL;
	scanf("%s",p1->num);
	while(strcmp(p1->num,"end")!=0)
	{
		scanf("%s%s%s%s%s",p1->name,p1->sex,p1->age,p1->score,p1->address);
     	p1->next=head;
		head=p1;
		p1=(struct student*)malloc(sizeof(struct student));
		scanf("%s",p1->num);
	}
	p1=head;
	while(p1!=NULL)
	{
		printf("%s %s %s %s %s %s\n",p1->num,p1->name,p1->sex,p1->age,p1->score,p1->address);
		p1=p1->next;
	}
}
main()
{
	int n=0;
	struct b
	{
		char a[60];
	}d,*q[10000];
	while(1)
	{
		gets(d.a);
		if(d.a[0]=='e')
			break;
		q[n]=(struct b *)malloc(sizeof(struct b));
		*q[n]=d;
		n++;
	}
	while(n--)
	{
		puts(q[n]->a);
	}
}