#include<stdio.h>
#include<stdlib.h>
struct list{
int data;
list *next;
};
int main4(){
list *headA,*headB,*headC,*temp,*p;
temp=(list*)malloc(sizeof(list));
temp->next=NULL;
headA=(list*)malloc(sizeof(list));
headA->next=temp;
p=(list*)malloc(sizeof(list));
p->next=NULL;
while(~scanf("%d",&temp->data)){
temp->next=p;
temp=p;
p=(list*)malloc(sizeof(list));
p->next=NULL;
}
temp=(list*)malloc(sizeof(list));
temp->next=NULL;
headB=(list*)malloc(sizeof(list));
headB->next=temp;
while(~scanf("%d",&temp->data)){
temp->next=p;
temp=p;
p=(list*)malloc(sizeof(list));
p->next=NULL;
}
temp=(list*)malloc(sizeof(list));
temp->next=NULL;
headC=(list*)malloc(sizeof(list));
headC->next=temp;
while(~scanf("%d",&temp->data)){
temp->next=p;
temp=p;
p=(list*)malloc(sizeof(list));
p->next=NULL;
}
temp=headA->next;
list *tempB,*pre;
pre=headA;
tempB=headB->next;
while(temp->next!=NULL){
int er=0;
tempB=headB->next;
while(tempB->next!=NULL){
if(temp->data==tempB->data){
er=1;
break;
}
tempB=tempB->next;
}
if(er==1){
pre->next=temp->next;
temp=temp->next;
} else{
pre=temp;
temp=temp->next;
}
}
temp=headA->next;
list *tempC;
pre=headA;
tempC=headC->next;
while(temp->next!=NULL){
int er=0;
tempC=headC->next;
while(tempC->next!=NULL){
if(temp->data==tempC->data){
er=1;
break;
}
tempC=tempC->next;
}
if(er==1){
pre->next=temp->next;
temp=temp->next;
} else{
pre=temp;
temp=temp->next;
}
}
temp=headA->next;
while(temp->next!=NULL){
printf("%d ",temp->data);
temp=temp->next;
}
printf("\n");
}