#include <stdio.h>
#define N 10
int icount;
int dele(int str[],int y)
{
int i,j,p=0;
icount=0;
for (i=0;i<N-icount;i++)
if( str[i] == y )
{
j=i;
p=1;
icount++;
for(;j<N-icount;j++)
str[j]=str[j+1];
i--;
}
return p;
}
int main()
{
int i,j,t,a[N],x;
for(i=0;i<N;i++)
scanf("%d",&a[i]);
scanf("%d",&x);
if(dele(a,x))
for(i=0;i<N-icount;i++)
printf("%d ",a[i]);
else
printf("fail!");
return 0;
}
#define N 10
int icount;
int dele(int str[],int y)
{
int i,j,p=0;
icount=0;
for (i=0;i<N-icount;i++)
if( str[i] == y )
{
j=i;
p=1;
icount++;
for(;j<N-icount;j++)
str[j]=str[j+1];
i--;
}
return p;
}
int main()
{
int i,j,t,a[N],x;
for(i=0;i<N;i++)
scanf("%d",&a[i]);
scanf("%d",&x);
if(dele(a,x))
for(i=0;i<N-icount;i++)
printf("%d ",a[i]);
else
printf("fail!");
return 0;
}