semeru/Code-Code-CloneDetection-POJ104 huggingface dataset:
//********************************
//*??????????? **
//*?????1300062805 **
//*???2013.11.1 **
//********************************
int main()
{
	int n, k, i, m=0,j;  
	int a[100001];
	cin >> n;
	for ( i = 0; i < n; i++)         // ????
	{
		cin >> a[i];
	}
	cin >> k;
    i=0;
	do
	{
		if ( a[i] == k )            // ???????????
        {
	m++;                            // ??????????????????
			for ( j = i+1;  j < n; j++)
			{
				a[j-1]=a[j];
			}
		}
		while(a[i]!=k)              // ?????????????
		i++;
	}while (i < n-m);
	for ( i=0; i <n-m-1 ; i++)        // ????
		cout << a[i] << " ";
	    cout << a[n-m-1];
	return 0;
}
int main()
{
	int n=0,m=0,i=0,j=0,k=0,sum=0,s=0;
	int a[1000000]={0};
	cin>>n;
	for(i=1;i<=n;i++)cin>>a[i];
	cin>>m;
	for(i=1;i<=n;i++)
	{
		if(a[i]==m)
		{
			sum++;
		}
	}
	for(i=1;i<=n;i++)
	{
		s=0;
			if(a[i]==m)
			{
				for(k=1;k<1000;k++)
				{
					s++;if(a[i+k]!=m)break;
				}
				for(j=i;j<=n-k;j++)a[j]=a[j+k];
			}
	}
	
	for(i=1;i<=n-sum-1;i++)
		cout<<a[i]<<" ";
	cout<<a[n-sum];
	cin.get();cin.get();
	return 0;
}
struct num
{
	int n;
	struct num * next;
};
int main()
{
	struct num *p1,*p2,*head,*temp;
	int n,k,i;
	scanf("%d",&n);
	for(i=0;i<n;i++)
	{
		p1=(struct num*)malloc(sizeof(struct num));
		scanf("%d",&p1->n);
		if(i==0)
		{
			p2=p1;
			head=p1;
		}
		else
		{
			p2->next=p1;
			p2=p1;
		}
	}
	p1->next=NULL;

	scanf("%d",&k);
	
	p1=p2=head;
	while(p1)
	{
		if(p1->n==k)
		{
			if(p1==head)
				head=p1->next;
			else
				p2->next=p1->next;
			p1=p1->next;
		}
		else
		{
			p2=p1;
			p1=p1->next;
		}
	}
	printf("%d",head->n);
	p1=head->next;
	while(p1)
	{
		printf(" %d",p1->n);
		p1=p1->next;
	}
	p1=head;
	while(p1)
	{
		temp=p1;
		p1=p1->next;
		free(temp);
	}
	return 0;

}
void main()
{
	int n,k,i,m,t,a[100001];
	scanf("%d\n",&n);
	for(i=0;i<n;i++)  scanf("%d",&a[i]);
	scanf("%d\n",&k);
	a[n]=k+1;
	for(m=0,i=0;i<n;i++) 
	{
		if(a[i]==k) 
		{
		    t=i;
			for(i=t;i<n;i++) a[i]=a[i+1];
			a[t]==k ? (i=t-1):(i=t);
			m++;
		}
	}
    if(m!=n)
	{
		for(i=0;i<n-m-1;i++) printf("%d ",a[i]);  
	    printf("%d",a[n-m-1]);
	}
}
//*******************************
//* ?????? **
//* ???2.cpp **
//* ??? ????????**
//* ???2012.11.1 **
//*******************************
int main ()
{
	int i, j = 0, k, m, n, l, b = 0;                    
	int a[1000001];                                 //??????????
	cin >> n;                                        //??????
	for (i = 0; i < n; i++)                            //????????????????
	{
		cin >> m;                                     
		a[i] = m;
	}
	cin >> k;                                          //????????
	while (j <= i)                                     //??????
	{
		if (a[j] == k)                                // ??????????
		{
			for (l = j; l <= i; l++)                    //?????????????
				a[l] = a[l + 1];                         
			b ++;                                       //????????????
		}
		else  
			j ++;                                     //???????????
	}
	for (i = 0; i < n - b - 1; i++)                     //???n-b???
		cout << a[i] << " " ;                           //?????????????????????????
	cout << a[n - b - 1];                               //??????????
	return 0;
}
int main(){
 int n,b[100002],i,k,m,j,m1;
 scanf("%d",&n);
 for(i=1;i<=n;i++){
  scanf("%d",&b[i]);
 }
 scanf("%d",&k);
 m=n;
 for(i=1;i<=n;i++){
  if(b[i]==k){m--;}
 }
 m1=m;
 for(i=1;i<=n;i++){
        if(b[i]!=k){
   m1--;
  }
  if(b[i]==k){
   for(j=i;j<=n-1;j++){
    b[j]=b[j+1];
   }
   b[n]=k;
   i=i-1;
  }
  if(m1==0){break;}
 }
 for(i=1;i<=n;i++){
  if(b[i]!=k&&m!=1){
   printf("%d ",b[i]);
   m=m-1;
  }
  else if(b[i]!=k&&m==1){
   printf("%d",b[i]);
   break;
  }
 }
 scanf("%d",&n);
 return 0;
}
/*
 * homework.cpp
 *
 *  Created on: 2013-10-21
 *      Author: dyx
 */
int main()
{
	int n;
	cin >> n;
	int sum[n],i;
	for( i=0;i<n;i++)
		cin >> sum[i];
    int k;//delete number?
    cin >> k;
    int j=0;
    for(i=0;i<n;i++)
    {
    	if(sum[i]==k)
    		continue;
    	if(sum[i]!=k&&j==0)
    	{
    		cout << sum[i];
    		j++;
    	}
    	else	
    	cout << " " << sum[i];
    }



return 0;






}
int main()
{
	int n,i,j,a[1000000],k;
	cin>>n;
	for(i=0;i<n;i++)
	{
		cin>>a[i];
	}
	cin>>k;
	for(i=0;i<n;i++)
	{
		if(a[i]!=k)
		{
			cout<<a[i];
			break;
		}
	}
	for(j=i+1;j<n;j++)
	{
		if(a[j]!=k)
			cout<<" "<<a[j];
	}
	return 0;
}
void main()
{
 int n,i,sum=0,j,b,t,*p;
 scanf("%d",&n);
 int a[n];
 for(i=0;i<n;i++)
  scanf("%d",&a[i]);
 p=a;
 scanf("%d",&b);
 for(i=0;i<n;i++)
  if(*(p+i)==b) sum++;
 for(i=0;i<(n-sum);i++)
    if(*(p+i)==b) 
     {for(j=i;j<n-1;j++)
         {*(p+j)=*(p+j+1);}
      i--; }
 for(i=0;i<(n-sum-1);i++)
  printf("%d ",*(p+i));
  printf("%d",*(p+i));
}
int main() 
{
    int n,i,j,k,c,m;
    scanf("%d",&n);
    int a[100000]; 
    for(i=0;i<n;i++)
    { 
        scanf("%d",&a[i]);
    } 
    scanf("%d",&k); 
    c=0;
    m=n;
   
        for(i=0;i<m;i++)
        {
            if(a[i]==k)
            {
                for(j=i;j<m;j++) 
                a[j]=a[j+1];
                c+=1; 
                m-=1;
                i--;       
            }  
        }   
    
        for(i=0;i<n-c-1;i++) 
        { 
        printf("%d ",a[i]);
        }
        printf("%d",a[n-c-1]);
    
      
        scanf("%d",&n);       
    return 0;  
}
void main()
{
	long int n,a,i,j,m;
	scanf("%ld",&n);
    long int b[100000];
	for(i=0;i<n;i++)
	{
		scanf("%ld ",&b[i]);
	}
     scanf("%ld",&a);
	 j=0;
for(i=0;i<n;)
	{
		if(b[i]!=a)
		{
			b[j]=b[i];
			j=j+1;
			i=i+1;
		}
		else
			i=i+1;
	}
	m=j-1;
	for(j=0;j<=m-1;j++)
	printf("%ld ",b[j]);
	printf("%ld",b[m]);
}
int main()
{
	int n,k,i,j=0;
	cin>>n;
	int a[n];
	for(i=0;i<n;i++)
		{cin>>a[i];}
	cin>>k;
	for(i=0;i<n;i++){
		if(a[i]!=k){
			a[j]=a[i];//???????????
			j++;
		}
	}
    for(i=j;i<n;i++)a[i]='\0';//??????????
	for(i=0;i<j;i++){
		if(i==0) cout<<a[i];
		else cout<<" "<<a[i];
	}//???j??
	return 0;
}
void main()
{
int n,m,i,k,l,j=0,*p;
int a[100000];
scanf("%d",&n);
p=a;
for(i=0;i<n;i++)
scanf("%d",p++);
p=a;
scanf("%d",&m);
for(i=0;i<n-j;i++)
{
if(*(p+i)==m)
{
j++;
{for(l=i;l<n;l++)
*(p+l)=*(p+l+1);}

i--;
}
}
for(i=0;i<n-j-1;i++)
{printf("%d ",*p);p++;}
p=a;
printf("%d",*(p+n-j-1));
}
void main()
{
	int a[100000],i,j,*p,*q,n,k;
	scanf("%d",&n);
	for(p=a,i=0;p<a+n;p++)
		scanf("%d",&*(p+i));
	printf("\n");
	scanf("%d",&k);
	for(p=a,q=a;p<a+n;p++)
	{
		if(*p!=k)
		{
			*q=*p;
			q++;
		}
	}
	for(p=a;p<(q-1);p++)
		printf("%d ",*p);
	printf("%d",*(q-1));
	printf("\n");
}
int main()
{
	int a[100000];
	int n,i,k,num=0;
	int *p=a;
	scanf("%d",&n);
	for(i=0;i<n;i++)
	{
		scanf("%d",p+i);
	}
	scanf("%d",&k);
	for(i=0;i<n-num;i++)
	{
		if(*(p+i)==k)
		{
			int *j=p+i;
			for(;j<a+n-num;j++)
			{
				*j=*(j+1);
			}
			i--;
			num++;
		}
	}
	for(i=0;i<n-num-1;i++)
	{
		printf("%d ",*(p+i));
	}
printf("%d",*(p+n-num-1));
	return 0;
}
void main()
{	
	int i,j,k,c;
	k = 0;
	c = 1;
	signed int b;
	signed int a[100000];
    scanf("%d",&i);
	for(j=0;j<i;j++)
    scanf("%d",&a[j]);
	scanf("%d",&b);
    for(j=0;j<i;j++)
	{
		if (a[j]!=b)
			k++;
			//printf("%d ",a[j]);
	}
	//printf("%d ",k);
	for(j=0;j<i;j++)
	{
		if (a[j]!=b)
		{
			if (c<k)
			{
				printf("%d ",a[j]);
				c++;
			}
			else
				printf("%d",a[j]);
		}
	}
}
int main()
{int n,k;
int i,j;
int a[100000];
cin>>n;
for(i=0;i<100000;i++)
{a[100000]=0;}
for(i=0;i<n;i++)
{cin>>a[i];}
cin>>k;
for(i=0;i<n;i++)
{if(a[i]==k)
{for(j=i;j<n-1;j++)
{a[j]=a[j+1];}
i=i-1;
n=n-1;
}}
for(i=0;i<n-1;i++)
{cout<<a[i]<<" ";
                }
cout<<a[n-1];
return 0;
    }
void main()
{
   int i,n,j,k,a[100000];
   int num[100000];
   scanf("%d",&n);
  
   for(i=0;i<n;i++)
   {
       scanf("%d ",&num[i]);
   }
    scanf("%d",&k);
   for(i=0;i<n;)
   {
	   if(num[i]==k)
	   {  
		   for(j=i;j<n-1;j++){num[j]=num[j+1];}
		   n--;
	   }else i++;
   }
   for(i=0;i<n-1;i++)
   {
	   printf("%d ",num[i]);
   }
   printf("%d",num[n-1]);
}
int main()
{
	int n,a[100000],k,i,j;
	scanf("%d",&n);
	for(i=0;i<n;i++)
	{
		scanf("%d",&a[i]);
	}
	scanf("%d",&k);
	for(i=0;i<n;)
	{
		if(a[i]==k)
		{
			if(i==n-1)
			{
				n=n-1;
				break;}
			else
			{
				for(j=i;j<n-1;j++)
				{
					a[j]=a[j+1];
				}
				n=n-1;
			}
			continue;
 
		}
		i+=1;
	}
	for(i=0;i<n;i++)
	{
		if(i==0)
		printf("%d",a[i]);
		else 
		printf(" %d",a[i]);
	}
	printf("\n");
	return 0;
}
/*
 * 1000012724_25.cpp
 *
 *  Created on: 2010-11-5
 *  Author: Iris
 *  ????3??
 *  ????????n(1<=n<=100000)????????????
 *  ?????n??????????n????????????????????????32???????????
 *  ????????k???????????k?????32???????????
 *  ????1?? ?????????????????????????????????????????
 */


int main()          //?????
{                   //??????
	int n,k;        //??????n?????????????,k????????
	cin>>n;         //??n
	int a[n];       //??????
	for (int i=0;i<=n-1;i++)
		cin>>a[i];  //????
	cin>>k;         //??k
	for(int j=0;j<=n-1;j++){//??????????
		if(a[j]==k){//????????
			for(int m=j;m<=n-2;m++)
				a[m]=a[m+1];//????????????????
			j=j-1;
			n=n-1;}}//?????????????????????j?n???
	for(int p=0;p<=n-2;p++)
		cout<<a[p]<<" ";
	cout<<a[n-1]<<endl;//????????
	return 0;       //???????????????????
}                   //??????
//****************************************
//*???????????               **
//*?????? 1100012802              **
//*???2011.10.19                     **
//****************************************
int main()
{
	int n,i,j,k,num=0;
	cin >> n;
	const int m = n;
	int a[m];
	for(i = 0;i <= m-1;i++)
		cin >> a[i];
	cin >> k;
	for(i = 0;i <= m-1;i++)
	{
		while(a[i] == k)
		{
			for(j = i;j <= m-1;j++)
				a[j]=a[j+1];
			num++;
		}
	}
	for(i = 0;i <= m - 2 - num;i++)
		cout << a[i] <<" ";
	cout << a[m - 1 - num];
	return 0;
}
//********************************
//*???2.???????? **
//*?????? 1300017623 **
//*???2013.10.30  **
//********************************
int main()
{
	int a[100000];
	int n, k, e= 0, d = 0;
	cin >> n;
	for (int i= 0; i < n; i++)
		cin >> a[i];
	cin >> k;
	for (int j = 0; j < n; j++)
		if (a[j] == k)
		{
			for (int p = j; p < (n - 1); p++)
				a[p] = a[p+1];
			n--;
			j--;
		}
		cout << a[0];
	for (int q = 1; q < n; q++)
		cout << " " << a[q];

	return 0;
}
int main()
{
	int n,a[100000],i,k,q,j,l=0;
	scanf("%d",&n);
	for(i=0;i<n;i++)
		scanf("%d",&a[i]);
	scanf("%d",&k);
	i=0;
	for(q=0;q<n;q++)
	{
		if(a[i]==k)
		{
			for(j=i;j<(n-1);j++)
				a[j]=a[j+1];
			i=i-1;
			l++;
		}
		i++;
	}
	for(i=0;i<n-l;i++)
	{
		if(i<(n-l-1))
		     printf("%d ",a[i]);
		if(i==(n-l-1))
			printf("%d",a[i]);
	}
	scanf("%d",1);
	return 0;
}
//
//  main.cpp
//  HomeWork 10.29
//
//  Created by airjcy on 10/29/12.
//  Copyright (c) 2012 ???. All rights reserved.
//


void deleteNumber(int a[],int n,int atPlace)
{
    int i;
    for (i = atPlace; i < n-1; i ++) {
        a[i] = a[i+1];
    }
}

int main(int argc, const char * argv[])
{

    int n;
    cin >> n;
    int a[n]; //?????
    int i;
    for (i = 0; i < n; i ++) {
        cin >> a[i];
    }
    
    int numberToDelete;
    cin >> numberToDelete;

    
    for (i = 0; i < n; i ++) {
        if (a[i] == numberToDelete) {
            deleteNumber(a, n, i);
            i --;
            n --;
        }
    }
    
    for (i = 0; i < n - 1; i ++) {
        cout << a[i] << " ";
    }
    cout << a[n - 1]; 
    
    
    return 0;
}
/*
 * 1.cpp
 *
 *  Created on: 2011-10-21
 *      Author: 1100012797
 */
int main()
{

	int n,no,cal;
	cal=0;
	cin>>n;
	int a[n];
	for(int i=0;i<n;i++)
	cin>>a[i];
	cin>>no;

	for(int k=0;k<n-cal;k++){
		while((a[k]==no)&&(k!=n-cal-1))
		{
			for(int j=k;j<n-cal-1;j++)
				a[j]=a[j+1];
			cal++;

		}
		if((k==n-cal-1)&&(a[k]==no))
			cal++;
	}

	for (int m=0;m<n-cal-1;m++)
		cout<<a[m]<<" ";
	cout<<a[n-cal-1]<<endl;

	return 0;

}
//********************************
//*???????????   **
//*?????? 1300012957 **
//*???2013.11.25  **
//********************************
int main ( )
{
	int s=0,t=0,a[100000]={0};
	int n,i,j,k;
	
	cin >> n ;
	
	for( i = 1;i <= n;i++ )
	{
		cin >> a[i-1] ;       //??????
	}
	
	cin >> k ;                //????????
	
	for( j = 1;j <= n;j++ )   //?for??????????k??????
	{
		if( a[j-1] != k )
			t++;              //?t?????k???????????????????????	
	}
	for( j = 1;j <= n;j++ )   
	{
		if( a[j-1] != k )     //???k?????
		{
		    s++;
			if( s <= t-1 )    //?????????k???s?t????????????
			{
				cout<< a[j-1] << " ";
			}
			else              //??????????????
			cout << a[j-1] ;
		}
	}
	return 0 ;
}
int a[1000001];
int main()
{
	int n,k,i,j;
	scanf("%d",&n);
	for(i=0;i<n;i++)
	{
		scanf("%d",&a[i]);
	}
	scanf("%d",&k);
	for(i=0;i<n;i++)
	{
		if(a[i]!=k)
		{
			printf("%d",a[i]);
			break;
		}
	}
    for(j=i+1;j<n;j++)
	{
		while((a[j]!=k)&&(j<n))
		{
			printf(" %d",a[j]);
			j++;
		}
		if(a[j]==k)
		{
			continue;
		}
	}
	return 0;
}
int main()
{
    int m,n,i,k;
    int a[100000];
    scanf("%d",&n);
    for(int i=0;i<n;i++)
    scanf("%d",&a[i]);
    scanf("%d",&m);
    for(int i=0;i<n;i++)
    {
       if(a[i]!=m)
      {
       printf("%d",a[i]);
       k=i;
       break;
      }
    }
    for(int i=k+1;i<n;i++)
    {
     if(a[i]!=m)
     printf(" %d",a[i]);
     getchar();
     getchar();
    }
}
int main()
{
	long n,i,a[100000]={0},k,j;
	scanf("%d",&n);
	for(i=0;i<n;i++)
	{
		scanf("%d",&a[i]);
	}
	scanf("%d",&k);
	for(i=0;i<n;i++)
	{
		if(a[i]==k)
		{
			
			for(j=(i+1);j<n;j++)
			{
				a[j-1]=a[j];
			}
			i-=1;
			n--;
		}

	}
	for(i=0;i<n;i++)
	{
		if(i==0)
			printf("%d",a[i]);
		else
			printf(" %d",a[i]);
	}

	return 0;

}
int main()
{
 int n,i;
 cin>>n;
 int a[100000];
 for(i=0;i<n;i++)
   cin>>a[i];
 int k,j=0;
 cin>>k;
 for(i=0;i<n-j;)
  {if(a[i]==k)
    {for(int t=i;t<n-j-1;t++)
       a[t]=a[t+1];
     j++;}
   else
    i++;}
 for(i=0;i<n-j-1;i++)
   cout<<a[i]<<" ";
 cout<<a[n-j-1]<<endl;
 return 0;
}
main()
{
    int n,m,i,j,k=0;
    int a[100000];
    scanf("%d",&n);
    for(i=0;i<n;i++)
     {
         scanf("%d",&a[i]);
     }
     scanf("%d",&m);
     for(i=0;i<n;i++)
      {
          if(a[i]!=m)
          k++;
      }
      for(i=0;i<n;i++)
       {
           if(a[i]!=m)
           {
                printf("%d",a[i]);
                k--;
                if(k>0)
                printf(" ");

           }

       }

}
int main()
{
	int n,k,x;
	cin>>n;
	int shu[n];
	for(int i=0;i<n;i++)
	{
		cin>>x;
		shu[i]=x;
	}//???????&??
	cin>>k;

	for(int m=0,b=0;m<n;m++)
	{
		if(b==0)
		{
			if(shu[m]!=k){cout<<shu[m];b=1;}//diyigeshuziqianmianmeiyoukongge
		}
		else
		{
			if(shu[m]!=k){cout<<" "<<shu[m];}
		}

	}




	return 0;

}
int main()
{
	int a[100000],n,k,i,j;
	scanf("%d",&n);
	for(i=0;i<=n-1;i++)
		scanf("%d",&a[i]);
	scanf("%d",&k);
    for(i=0;i<=n-1;i++)
	{	if(a[i]!=k)
		{printf("%d",a[i]);
		break;}
	}
		for(j=i+1;j<=n-1;j++)
		{if(a[j]!=k)printf(" %d",a[j]);
		}
}
int main()
{
	int n, i;
	cin >> n;
	int a[100000];
	for (i = 0; i <= n - 1; i++)
	{
		cin >> a[i];
	}
	int k, p = 0, j = 0;
	cin >> k;
	for (i = 0; i <= n - 1; i++)
	{
		if (a[i] != k)
		{
			cout << a[i];
			p = i;
			break;
		}
	}
	for (j = p + 1; j <= n - 1; j++)
	{
		if (a[j] != k)
			cout << " " << a[j];
	}
	cout << endl;

	return 0;
}
int main()
{
	int n,i,a[100001],k,b=0;
	cin>>n;
	for(i=1;i<=n;i++)
		cin>>a[i];
	cin>>k;
	b=n;
	for(i=n;i>=1;i--)
	{
		if(a[i]==k)b--;
		if(a[i]!=k)break;
	}
	for(i=1;i<=n;i++)
	{
		if(a[i]!=k)
		{
			if(i<b)cout<<a[i]<<' ';
			else cout<<a[i];
		}
	}
	return 0;
}
void main()
{
	long grapes[100000],k;//????
	long *pg=grapes;
	long n,i,j;

    scanf("%ld",&n);//??????
	for(i=0;i<n;i++)
		scanf("%ld",pg+i);
	scanf("%ld",&k);

	for(i=0;i<n;i++)//???k????
		if(k==*(pg+i))
		{
			if(k==*(pg+i+1))
			{
				for(j=i;j<n;j++)
					*(pg+j)=*(pg+j+2);
				n-=2;
			}
			else 
			{
				for(j=i;j<n;j++)
					*(pg+j)=*(pg+j+1);
				n--;
			}
			i--;
		}		
	
	printf("%ld",*pg);//????
	for(i=1;i<n;i++)
		printf(" %ld",*(pg+i));
}
int main(){
	int n,a,u[1000000],b,c;
	b=0;
	c=0;
	scanf("%d",&n);
	for(int i=0;i<n;i++){
		scanf("%d ",&u[i]);
		}
		scanf("%d",&a);
		for(int i=0;i<n;i++){
			if(u[i]!=a){
				b=b+1;}}
		for(int i=0;i<n;i++){
			if(u[i]!=a){
				c=c+1;
				if(c<b){printf("%d ",u[i]);}
				else if(c==b){printf("%d",u[i]);}}}
				scanf("%d",&n);
	return 0;
	}
int main()
{
 int n, k, i, j, l, m, o, b=0;
 cin >> n;
 int a[n];
 for ( i = 0 ; i <= n - 1 ; i++)
 {
  cin >> a[i];
 }
 cin >> k;
 for ( j = 0 ; j <= n - 1 ; j++)
 {
   if ( a[j] == k ) 
   {
     for ( l = j ; l <= n - 1 ; l++)
     {
       a[l] = a[l+1];
      }
       j--;
     b++;
   }
 }
  for ( m = 0 ; m <= n - b - 1 ;  m++)
  { 
    if ( m != n - b - 1 )
    cout << a[m] <<" ";
    else
    cout << a[m];
  }
 return 0;
}
int main(){
	int n,m,i,j,k;
	int p[100001];
    scanf("%d",&n);
	for(i=0;i<n;i++)
		scanf("%d",&p[i]);
	scanf("%d",&m);
	for(j=0;j<n;j++)
	{
		if(p[j]!=m)
		{
			printf("%d",p[j]);
			break;
		}
	}
	for(k=(j+1);k<n;k++)
	{
		if(p[k]!=m)
			printf(" %d",p[k]);
	}

	return 0;
}
int main()
{
	int n,i,k,j,t=0,s,m;
	cin>>n;
	int J[100000];
	for ( i=0 ; i<n ; i++)
	{cin>>J[i];}
	cin>>k;
	for ( j=0 ; j<n-t ; j++)
	{
        if (J[j]!=k) 
		  continue;
		t++;
		for ( s=j+1 ; s<=n-t; s++)
		{J[s-1]=J[s];}j--;
	}
	for ( m=0 ; m<n-t-1 ; m++)
         cout<<J[m]<<" ";
	cout<<J[n-t-1]<<endl;
	return 0;
}
main()
{
int n,i,k,count=0;
scanf("%d",&n);
int a[n];
for(i=0;i<n;i++)
scanf("%d",&a[i]);
scanf("%d",&k);
for(i=0;i<n;i++)
{
if(a[i]!=k)
{
count++;
if(count==1)
printf("%d",a[i]);
if(count>1)
printf(" %d",a[i]);
}
}
}
int main()
{
	int n=0,k=0,a[150000],i=0,j=0,temp=0,m=0;
	cin>>n;
	for (i=0;i<n;i++)
	{
		cin>>a[i];
	}
	cin>>k;

	for (i=0;i<n;i++)
	{
		if (a[i]!=k)
			continue;
		else if (a[i]==k)
		{
			for (j=i;j<n;j++)
			{
				a[j]=a[j+1];//???????????
			}
			m++;
			i--;//??i????????????????????????????????????????????????i--??????i?????
		}
	}
	for (i=0;i<(n-m);i++)
	{
		if (i<(n-m-1))
			cout<<a[i]<<" ";//???????
		else if (i==(n-m-1))
            cout<<a[i]<<endl;//???????
	}
	return 0;
}
int main()
{int a[100000],n,m,j,i,*p;
scanf("%d",&n);
p=a;
for (i=0;i<n;i++)
scanf("%d",p++);
scanf("%d",&m);
p=a;

for(i=0;i<n;i++)
{if (*(p+i)==m)
{for(j=i;j<n;j++)
*(p+j)=*(p+j+1);
i=i-1;n=n-1; }}
p=a;

for(i=0;i<n-1;i++,p++)
printf("%d ",*p);
printf("%d",*p);
      }
int main()
{
	int n, a[100000], k, m = 0, q = 0, i, j, r;
	cin >> n;
	for (r=0; r < n; r++)
		cin >> a[r];
	cin >> k;
	for (i = 0; i < n - m ; i++)
		if (a[i] == k)
		{
			for (j=i; j< n - m; j++)
				a[j] = a[j+1];
			m++;
			i--;
		}
	for (q = 0; q < n - m - 1; q++)
		cout << a[q] << " ";
	if (q == n - m - 1)
		cout << a[q];
	return 0;
}
void main()
{
    int n,m;
    int a[100001];
    int *p;
    scanf("%d",&n);
    for(p=a;p<a+n;p++)
    scanf("%d",p);
    scanf("%d",&m);
    for(p=a;p<(a+n);p++)
    {
    	if(*p==m)
    	{
    		int *q;
    		for(q=p;q<(a+n-1);q++)
    		*q=*(q+1);
    		n=n-1;
    		p=p-1;
    	}
    }
    for(p=a;p<a+n-1;p++)
    printf("%d ",*p);
    printf("%d",*p);
}
//*********************************************************
//*????????????                               *
//*?  ?????                                         *
//*?????2010.10.29.                                  *
//*??????????????????                   *
//*********************************************************
int main()
{
	int n, i;                                  //?????n???i?????
	cin>>n;
	int a[100000];                             //??????
	for ( i = 0; i < n; i ++ )
	{
		cin>>a[i];                             //??????
	}
	int m;                                     
	cin>>m;                                    //??m???????
	int k, t,count = 0;
	for ( k = 0, t = 0; t < n; t ++ )          
	{
		if ( a[t] != m )                       //??a[t]?????????????a[k]?
		{
			a[k] = a[t];
			k ++;
		}
		else
			count ++;                         //????????
	}
	for ( i = 0; i < n - count; i ++)         //??n-count??  
	{
		if ( i == n - count - 1)
			cout<<a[i]<<endl;                  //??????????????
		else
			cout<<a[i]<<" ";                   //????????????????
	}
	return 0;
}
int main()
{
	int n,a,b,c,d;
	scanf("%d",&n);
	int z[200000];
	for(a=1;a<=n;a++)
	{
		scanf("%d",&z[a]);
	}
	scanf("%d",&b);
	d=0;
	a=n;
	while(z[a]==b)
	{
		a-=1;
	}
	n=a;
	for(a=1;a<=n;a++)
	{
		if (z[a]!=b)
		{
			if(a<n)
		printf("%d ",z[a]);
			else
	printf("%d",z[a]);
		}
	}
	return 0;
}
int main ( )
{
  int n,*p,i=0,x;
  scanf("%d",&n);
  int a[n];
  p=a;
  for (i=0;i<n;i++)
  scanf("%d",p++);
  scanf("%d",&x);
   p=a;
   for (p;p<a+n;p++)
   { if (*p!=x) 
   {printf("%d",*p);    break;}}
    p=p+1;
   for (p;p<a+n;p++)  
  { if (*p!=x) 
   printf(" %d",*p);}
   }
/*
?????
???2010?10?29?
??????????
????????? ????????
*/
int main()
{
	int n,i,b,t,k,d,j,s=0;
	int a[100000]={0};
	cin>>n;
	for(d=0;d<=n-1;d++)
	{
		cin>>b;
		a[d]=b;
	}//?????????
	cin>>t;
	for(i=0;i<=n-1-s;)
	{
		if(t==a[i])//??????
		{	s++;
			for(j=i;j<=n-1;j++)
				a[j]=a[j+1];//???????
			i--;
		}
		else i++ ;
	}
	cout<<a[0];
	for(k=1;k<n-s;k++)
	{	 
		cout<<" "<<a[k];
	}//??????????
	return 0;
}
struct sz
{
	int num;
	struct sz *next;
};

struct sz *creat(int n)
{
	struct sz *head,*p1,*p2;
	int i;

	p1=p2=(struct sz *) malloc(LEN);
	for(i=1;i<=n;i++){
		if(1==i) head=p1;
		else p2->next=p1;
		p2=p1;
		scanf("%d",&p1->num);
		p1=(struct sz *) malloc(LEN);
	}
	p2->next=NULL;

	return head;
}

void print(struct sz *head)
{
	struct sz *p;
	p=head;
	do{
		printf("%d",p->num);
		p=p->next;
		if(p!=NULL) putchar(' ');
		else putchar('\n');
	}while(p!=NULL);
}

struct sz *move(struct sz *head,int k)
{
	int first=1;
	struct sz *p1,*p2;
	p1=head;
	do{
		if(p1->num==k){
			if(first) head=p1->next;
			else p2->next=p1->next;
		}
		else{
			first=0;
			p2=p1;			
		}
		p1=p1->next;
	}while(p1!=NULL);
	return head;
}

void main()
{
	int n,k;
	struct sz *head;

	scanf("%d",&n);
	head=creat(n);
	scanf("%d",&k);	
	head=move(head,k);
	print(head);
}
//****************************************
//*???????????    **
//*??????  1100012927       **
//*???2011.10.22                          **
//*****************************************

int main ()
{
    int n, i, j, k;
    cin >> n;
    int a[n];
    for (i = 0;i < n;i++)
    {
        cin >> a[i];
    }
    cin >> k;
    for (i = 0;i < n;i++)
    {
        if (a[i] == k)
        {
            j = i;
            for (; i < n;i++)
            {
                a[i] = a[i + 1];
            }
            n--;
            i = j - 1;
        }
    }
    for (i = 0; i < n; i++)
    {
        if (i < n - 1)
        cout << a[i] << " ";
        else cout << a[i];
    }
    return 0;
}
int main()
{
    int n;
    int a[100000];
    int k;
    scanf("%d",&n);
    int i,j,num=0,count=0;
    for(i=0;i<n;i++)
    scanf("%d",&a[i]);
    scanf("%d",&k);
    for(i=0;i<n;i++)
    {
           if(a[i]!=k)
           num++;
    }
    for(i=0;i<n;i++)
    {
           if(a[i]!=k)
           {
                      count++;
                      if(count==num)
                      printf("%d",a[i]);
                      else
                      printf("%d ",a[i]);
           }
    }
}
/*	???:??????
	???:1000012896 leo
	????:2010.10.29
	????:??????????
	**/
int main ()
{
	int a[100000]; // ????
	int n,i,j,k,count = 0; // ??????,????*2,????,????????
	cin >> n;
	for (i = 0; i <= n - 1; i++)
	{
		cin >> a[i]; // ???
	}
	cin >> k;
	for ( i = 0; i <= n - 1;)
	{
		if ( a[i] == k )
		{
			count = count + 1;
			for ( j = i; j <= n - 2; j++) // ????????????
			{
				a[j] = a[j + 1];
			}
			if ( count + i == n) // ??????????,?????
				break;
		}
		else 
		{
			i++; // ???????????
			if (count + i == n) // ??????????????
				break;
		}
	}

	if( count != n) // ????????
	{
		cout << a[0];
		for ( i = 1; i <= n - 1 -count; i++ ) // ??????????
		{
		cout << ' ' << a[i];
		}
	}

	return 0;
}