semeru/Code-Code-CloneDetection-POJ104 huggingface dataset:
void main()
{
    long int b,c,n,i,j;
    long int q[1000000];
     scanf("%ld\n",&n); 
    for(i=0;i<n;i++)
    scanf("%ld",&q[i]);
    scanf("%ld",&b);
    for(i=0;i<n;i++)
    {
    	c=0;
    	if(q[i]==b)
    	{for(j=i;j<n;j++)
    		q[j]=q[j+1];
    		c=1;
    	}
    	if(c==1)
    	{n=n-1;
    	i=i-1;
    	}
    }
    for(i=0;i<n-1;i++)
    printf("%ld ",q[i]);
    printf("%ld",q[n-1]);
}
int main()
{
	int n,m,i=1,j=1,k=1,sum=0,a[200000]={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++)
	{
			if(a[i]==m)
			{
				for(k=1;k<1000;k++)
				{					                                        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];
	return 0;
}
void swap(int*,int*);
int main()
{
	int n,k,i,j,js=0;
	int a[100000];
	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++)
			{
				if(a[j]!=k)
				{
					
					swap(&a[i],&a[j]);
					break;
				}
			}
		}
	}
	for(i=0;i<n;i++)
	{
		if(a[i]!=k)
		{
			printf("%d",a[i]);
			if(a[i+1]!=k && i!=n-1)
				printf(" ");
		}
	}

	return 0;
}
void swap(int*a,int*b)
{
	int e;
	e=*a;
	*a=*b;
	*b=e;
}
void main()
{
	int n,a[100000],k,i,j,b[100000],c;
	scanf("%d",&n);
	for(i=0;i<n;i++)
	scanf("%d",&a[i]);
	scanf("%d",&k);
    j=0;
	c=0;
	for(i=0;i<n;i++)
	{	
		if(a[i]!=k)
		{b[j]=a[i];j=j+1;c=c+1;}
	}
	for(j=0;j<c-1;j++)
		printf("%d ",b[j]);
	printf("%d\n",b[j]);
}
//
//  main.cpp
//  hw
//
//  Created by ? ? on 12-12-13.
//  Copyright (c) 2012? ? ?. All rights reserved.
//


int main()
{
    int n;
    cin>>n;
    int num[100000]={0};
    for (int i=0; i<n; i++) {
        cin>>num[i];
    }
    int k;
    cin>>k;
    /*int t=0;
    for (int i=0; i<n; i++) {
        if (num[i]==k) {
            t++;
        }
    }
    for (int i=0; i<n-t; ) {
        if (num[i]==k) {
            for (int j=i+1; j<n-1; j++) {
                num[j-1]=num[j];num[j]=num[j+1];
            }
        }
        else
        {
            i++;
        }
    }
    cout<<num[0];
    for (int i=1; i<n-t; i++) {
        cout<<" "<<num[i];
    }*/
    int j;
    for ( j=0; j<n; j++) {
        if (num[j]!=k) {
            cout<<num[j];
            break;
        }
    }
    for (int i=j+1; i<n; i++) {
        if (num[i]!=k) {
            cout<<" "<<num[i];
        }
    }
    return 0;
}
/*
hw.cpp
????yang?
?????????????????????????????????????? 
???10.28
*/
int main()
{
	int n[100001],k,n1,z=0;
	cin>>n1;
	for(int i=0;i<n1;i++)
	{cin>>n[i];}
	cin>>k;//??????????????
	for(int i=0;i<n1;i++)
	{
		if(n[i]!=k){//????k?????
			z=z+1;//??????????????
			if(z==1)
				cout<<n[i];
			else
				cout<<" "<<n[i];//???????
		}
	}
	return 0;
}
//*****************************************
//*???Oct 30, 2013 - ???????? **
//*?????? 1300012719               **
//*???2013.10.30                      **
//*****************************************
int main()
{
	int i, j, k, m, n;                //i,j?????,k???????,m????????????,n???????                                  
	int a[100000];                    //????,???????????m
	cin >> n;                   
	m = n;
	for (i = 0; i < n; i++)
		cin >> a[i];                  //??a[0]?a[n-1]?n?????????????k
	cin >> k;
	if (a[n - 1] == k)                //?????????????????,???????????k?????,??????????
	{                                 //????????,??????????x?k?????????k????(?k+1)?????n-k???,???????????
		a[n - 1] = k + 1;
		m = m - 1;
	}
	for (i = 0; i < n - 1; i++)
	{
		while (a[i] == k)             //??a[0]?a[n-2],???k,??????a[i],?a[i]?????????,??????????,??a[i]???k
		{
			for (j = i; j < n - 1; j++)
				a[j] = a[j + 1];
			m = m - 1;
		}
	}
	for (i = 0; i < m; i++)           //????????m????,??????
	{
		cout << a[i];
		if (i == m - 1)               //????a[m-1]?????,??????
			cout << endl;
		else
			cout << " ";
	}
	return 0;
}
int main()
{
    int n;
    scanf("%d",&n);
    int* p;
    
    p=(int*)malloc(n*sizeof(int));
    for(int i=0;i<=n-1;i++)
    {
        scanf("%d",&p[i]);    
            
            }
    
    int del;
    scanf("%d",&del);
    int c=0;
    for(int i=0;i<=n-1;i++)
    {
            if(p[i]!=del) {c++;
                         if(c==1)   printf("%d",p[i]);
                         else printf(" %d",p[i]);
                         }
            
            
     }
    
    
    
    
    
    
    
    
    
    
    
}
int in[100000]={0};
int main()
{ int n,k,i,j,count=0;
cin>>n;
for(i=0;i<n;i++) cin>>in[i];
cin>>k;
restart:
for(i=0;i<n;i++)
{
	if(in[i]==k)
	{
		count++;
		for(j=i;j<n-1;j++) in[j]=in[j+1];
		in[n-1]=k-1;

		goto restart;
	}
}

cout<<in[0];
for(i=1;i<n-count;i++) cout<<" "<<in[i];
   cin.get();
   cin.get();
   cin.get();


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

	return 0;
}
main()
{
	long i,j,n,k,m=0,t;
	long a[100000];
	scanf("%ld",&n);
	for(i=0;i<n;i++)
		scanf("%ld",&a[i]);
	scanf("%ld",&k);
	for(i=0;i<n;i++)
	{
		if(a[i]==k)
		{
			m++;
			for(j=0;j<=i;j++)
			{
				t=a[0];
			    a[0]=a[j];
		    	a[j]=t;
			}
		}
	}
	for(i=m;i<n-1;i++)
		printf("%ld ",a[i]);
	printf("%ld",a[n-1]);
}
int main(){
    int n,k,i,j=0;
    scanf("%d",&n);
    int*a=(int*)malloc(sizeof(int)*n);
    int*b=(int*)malloc(sizeof(int)*n);
    for(i=0;i<n;i++){
                     scanf("%d",&a[i]);                 
    }
    scanf("%d",&k);
    for(i=0;i<n;i++){
                     if(a[i]!=k){
                                 b[j]=a[i];
                                 j++;            
                     }                 
    }
    for(i=0;i<j-1;i++){
                       printf("%d ",b[i]);                   
    }
    printf("%d",b[j-1]);
    free(b);
    free(a);
    return 0;
}
main()
{
 int i,d,k,*p,j;
 scanf("%d",&k);
 p=(int *)malloc(k*sizeof(int));
 for(i=0;i<k;i++)
   scanf("%d",&p[i]);
 scanf("%d",&d);
 for(i=0;i<k;i++)
   {
    if(p[i]==d)
     {
      for(j=i;j<k-1;j++)
         p[j]=p[j+1];
      k--;
      i--;
     }
   }
 int y=0;
 for(i=0;i<k;i++)
  {
   if(y!=0)
     printf(" ");
   printf("%d",p[i]);
   y=1;
  } 
 free(p);
}
int main()
{
	int n;
	int a[100001]={0};
	int k;
	int i,j,l=0,m=0;
	cin>>n;
	for (i=1;i<=n;i++)
		cin>>a[i];
	cin>>k;
	for (i=1;i<=n;i++)
		if (a[i]==k)
			l++;
	for (i=1;i<=n-m;i++)
	{
		if (a[i]==k)
		{
			for (j=i;j<=n-1;j++)
			{
				a[j]=a[j+1];
			}
			i=i-1;
			m++;
		}
	}
	for (i=1;i<=n-l-1;i++)
		cout<<a[i]<<' ';
	cout<<a[n-l]<<endl;
	return 0;
}
int main ()
{
    int n , k;
    int step = 0;
    int i;
    cin >> n;
    int a[n];
    for ( i = 0; i <= n - 1; i++ )
    {
        cin >> a[i];
    }
    cin >> k;
    for ( i = 0; i <= n - 1; i++ )
    {
        if ( a[i] == k )
        step++;
        else
        a[ i - step ] = a[i];
    }
    for ( i = 0; i <= n - 1 - step; i++ )
    {
        if ( i == 0 )
        cout << a[0];
        else
        cout << " " << a[i];
    }
}
int main()
{
	int N,i,k,b=0,sum=0;
	scanf("%d",&N);
	int *a=(int*)malloc(sizeof(int)*N);
	for(i=0;i<N;i++)
	{
		scanf("%d",&a[i]);	
	}
	scanf("%d",&k);	
	
	for(i=0;i<N;i++)
	{
		if(a[i]!=k)
		sum++;
		
	}
	for(i=0;i<N;i++)
	{
		
		if(a[i]!=k)
		{
			b++;
			if (b!=sum)
			printf("%d ",a[i]);
			else
			printf("%d",a[i]);		
		}
		
	}
	free(a);
	return 0;
	
}
int main()
{
	int i,j,n,k,a[100000];
	cin>>n;
	for(i=0;i<n;i++)
	{
		a[i]=-1;
		cin>>a[i];
	}
	cin>>k;
	int count=0;
	for(i=0;i<n-count;i++)
	{
		while(a[i]==k&&i!=n-count-1)
		{
			for(j=i;j<n-1;j++)
			{
				a[j]=a[j+1];
			}
			count++;
		}
		if(a[i]==k&&i==n-count-1)
		{
			count++;
		}
	}
	for(i=0;i<n-count-1;i++)
	{
		cout<<a[i]<<' ';
	}
	cout<<a[n-count-1]<<endl;
	return 0;
}
//**************************
//*???????????  **
//*?????? 1300012863 **
//*???2013.11.1        **
//**************************
int main()  
{ 
	int n,i,k,j,t;
	int a[100020];                   //????
	cin>>n;                         //?????????
	t = n;
	for(i=1;i<=n;i++)               //???????????
	{
		cin>>a[i];
	}
	cin>>k;                         //???????
	for(i=1;i<=t;i++)               //?????????????????
	{
		if(a[i]==k)                 //?????
		{
			t--;      
			for(j=i;j<=t;j++)       //????????????
			{
				a[j] = a[j+1];
			}
			i--;
		}
	}
	for(int m =1;m<=(t-1);m++)     //????
	{
		cout<<a[m]<<" ";
	}
	cout<<a[t];
	return 0;
}
/*
 * 0a.cpp
 *function:???????????????????????????????????
 ?????????????????????????????
 *  Created on: 2012-11-8
 *      Author: sear
 */
int main() {
	int n, k, a[100005], i, j, m = 0;/*n???????,k??????,
	 a[100005]????????,i,j?????,m?k???*/
	cin >> n;//??n
	for (i = 0; i < n; i++)
		cin >> a[i];//?????????
	cin >> k;//???????k
	for (i = 0; i < n; i++) {
		if (a[i] == k)
			m = m + 1;
	}//????k???
	for (i = 0; i < n - m; i++) {
		//????????k????????
		if (a[i] == k) {//??a[i]??k
			for (j = i + 1; j < n; j++) {//?a[i]?????k??
				if (a[j] != k) {//a[j]???k
					a[i] = a[j];//a[j]????a[i]
					i = i + 1;//i??1?a[i]??????????????
				}
			}
			break;//???????????????????
		}
	}
	for (i = 0; i < n - m - 1; i++)
		cout << a[i] << " ";//???????n-m??
	cout << a[n - m - 1];
	return 0;//????
}
int main()
{ 
	int a[100001],n,i,m,l,k;
	cin>>n;
    for (i = 1;i <= n;i++) cin >> a[i];
	cin >> k;
	a[n+1] = k;
	l = 2;
	for(i=n;i>=1;i--)
	{ 
		if(a[i] == k)
		{	
			for (m = i; m <= n; m++) a[m] = a[m+1];
		}
	}
	cout << a[1];
	while(a[l] != k)
	{
	    cout << " " << a[l];
	    l = l + 1;
	}
cout<<endl;
	return 0;
}
void main ()
{
	int n,k,j,i,sum=0;
	
	int a[1000000];
	scanf ("%d",&n); 
	for (j=0;j<=n-1;j++)
		scanf("%d ",&a[j]);
	scanf("%d",&k);
	for (j=0;j<n;j++)
	{
		if (a[j]==k)
		{
			{
           for (i=j;i<n;i++)
		  
			   a[i]=a[i+1];
			}
		   sum=sum+1;
		  
		   j=j-1;
		}
		else a[j]=a[j];
		
	}
	
	printf("%d",a[0]); for (j=1;j<n-sum;j++)printf(" %d",a[j]);
}
void main()
{
	int i,j,n,b,m;
	int a[100000];
    scanf("%d\n",&n);
	for(i=0;i<n;i=i+1)
		scanf("%d",&a[i]);
    scanf("%d",&b);
    
	for(i=0,m=0;i<n;i=i+1)
		if(a[i]==b){m=m+1;
		{for(j=i+1;a[j]!=b;j=j+1)
			a[j-m]=a[j];}}
		
		
	for(i=0;i<(n-m-1);i=i+1)
		printf("%d ",a[i]);
	printf("%d",a[n-m-1]);
}
void main()
{
	int *p,i,j,n,m,a[200000],k=0;
	scanf ("%d\n",&n);
	p=a;
	for (i=0;i<n;i++)
	{
		scanf ("%d",(p+i));
	}
	scanf ("%d",&m);
	for (i=0,p=a;i<n;i++)
	{
		if (*(p+i)==m)
		{
			k++;
			for (j=i;j<n;j++)
			{
				*(p+j)=*(p+j+1);
			}
			i--;
		}
	}
	for (i=0,p=a;i<n-k-1;i++)
	{
		printf ("%d ",*(p+i));
	}
	printf ("%d",*(p+n-k-1));
}
int main ()
{
	int n, a[100000], i, j;
	cin >> n;
	for (i = 0; i <= n - 1; i++ )
	{
		cin >> a[i];
	}
	int k, count = 0;
	cin >> k;
	for (i = 0; i <= n - 1 - count; i++ )
	{
		if (a[i] == k)
		{
			count ++ ;
			for (j = i; j <= n  - 1 - count; j++ )
			{
				a[j] = a[j + 1];
			}
			i-- ;
		}
	}
	cout << a[0];
	for (i = 1; i <= n - 1 - count; i++ )
	{
		cout << " " << a[i];
	}
	
	return 0;
}
// *****************************************************************************
//*????????????.cpp
//*??;1300012725
//*?????2013.10
//*?????????????
//******************************************************************************



int main()
{
	int a [100000];
	int n, m, count=0;         //count????????

	cin >> n;                 //??n
	for( int i=0; i<n; i++ )
	{
		cin >> a[i];         //?????
	}
	cin >> m;
	for( int j = 0; j < n-count;  )
	{
		if( a[j] == m )
		{
			count += 1;      //??????????????????
			for( int k = j; k < n-count; k++ )
			{
				a[k] = a[k+1];     //????
			}
		}
		else j += 1;
	}
	for( int t = 0; t < n-count-1; t++ )
	{
		cout << a[t] << ' ';        //???????
	}
	cout << a[n-1-count] << endl;   //??????

	return 0;
}
int main()
{
int a[100000];
int x,n,i,j,k;
scanf("%d",&n);
for(i=0;i<n;i++)
{
	scanf("%d",&a[i]);
}
scanf("%d",&x);
k=0;
for(i=0;i<n-k;i++)
{
  while(a[i]==x)
  {
	  for(j=0;j<(n-k-i-1);j++)
		  a[i+j]=a[i+j+1];
	  k++;
	  if(i>=n-k)
		  break;
  }
}
for(i=0;i<(n-k-1);i++)
	printf("%d ",a[i]);
	printf("%d",a[i]);
return 0;
}
int main(){
	int n,i,j,k,p=0;
	cin>>n;
	int a[100000];
	for(i=0;i<n;i++){
		cin>>a[i];
	}cin>>k;
	for(i=0;i<n-p;i++){
		if(a[i]==k){
			for(j=i;j<n-p-1;j++){
				a[j]=a[j+1];
			}p++;i--;
			if(j<n-1)continue;
		}
	}for(i=0;i<n-p-1;i++)
		cout<<a[i]<<' ';
	cout<<a[n-p-1];
	return 0;
}
/*
 * 1000010548-26.cpp
 *  ??: 2010-10-30
 *  ??: ??
 *  ???????????
 */
int main(){//?????
	int n,k;//??????
	int i,j;//??????
	cin>>n;//??n
	int a[n];//???????
	for(i=0;i<=n-1;i++)//??????
	  cin>>a[i];//????????
	cin >>k;//??k
	for(i=0;i<=n-1;i++){//??????
		if (a[i]==k){//??
			for(j=i;j<n-1;j++)//?????????
				a[j]=a[j+1];//????????????????
			i--;// i??
			n--;//j??

		}

	}
	for(i=0;i<=n-2;i++)//??????
		cout<<a[i]<<" ";//???????????
	cout<<a[i]<<endl;//??????
	return 0;//?????
}
void main()

{
   int n,i,m,j;
	long int a[100000];
	long int *point,*qoint,b;
	
	scanf("%d",&n);
	for(i=0;i<n;i++)
	scanf("%ld",&a[i]);
    scanf("%ld",&b);
	point=a;
	m=0;
	for(i=0;(i<n)&(m<n);point++,i++)
	{
	    if(*point==b)
		{
			qoint=point;
			for(j=i;j<n-1;qoint++,j++)
			{*qoint=*(qoint+1);}
			*qoint=b;
		    point=point-1;
			i=i-1;
			m=m+1;

		       
			
		}
	
		 
	}
   
	point=a;
	if(*point!=b)
	printf("%ld",*point);
	point=point+1;
	for(i=1;i<n;i++,point++)
	if(*point!=b)
    printf(" %ld",*point);

}
/**
*@file 2.cpp
*@author ???
*@date 2013-10-30
*@description ????????
*/


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

	}
	cin>>k;
	i=0;
	
	t=0;
	while (i<n)
	{
		if (a[i]!=k)
			{
			i++;
			}
		else
		{
			t=i;
			
			while(t<(n-1))
			{
				a[t]=a[t+1];
				t++;

			}
			n--;
		}
	}
	i=0;
	for(i=0;i<n-1;i++)
		cout<<a[i]<<" ";
	cout<<a[n-1]<<endl;;
	return 0;
}
int main(int argc, char* argv[])
{
	int *p,n,i,k,j;
	scanf("%d",&n);
	p=(int*)malloc(sizeof(int)*n);
	for(i=0;i<n;i++)
	{
		scanf("%d",&p[i]);
	}
	scanf("%d",&k);
	for(i=0;i<n;i++)
	{
		if(p[i]==k)continue;
		else 
		{
			printf("%d",p[i]);
			break;
		}
	}
	for(j=i+1;j<n;j++)
	{
		if(p[j]==k)continue;
		else printf(" %d",p[j]);
	}
	free(p);
	return 0;
}
/*
 * 11055.cpp
 *
 *  Created on: 2011-11-5
 *      Author: Administrator
 */
int main ()
{
	int n,k,i,j,num=0,dnum=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)
		{
			for(j=i;j<n;j++)
				a[j]=a[j+1];
			i=i-1;
			dnum=dnum+1;
		}
		num=num+1;
		if(num==n) break;
	}
	cout<<a[0];
	for(i=1;i<n-dnum;i++)
		cout<<" "<<a[i];
	return 0;
}
int a[100000];
int main(){
	int n=0,i=0,k=0,b=0;
	scanf("%d\n",&n);
	for(i=0;i<n-1;i++){
		scanf("%d ",&a[i]);
	}
	scanf("%d\n",&a[n-1]);
	scanf("%d",&k);
	for(i=0;i<=n-1;i++){
		if(a[i]!=k){
			if(b==0){
			  printf("%d",a[i]);
			  b+=1;
		    }
		    else{
		    	printf(" %d",a[i]);
		    }
		}
	}
	printf("\n");
	return 0;
}
//**********************************
//*  ????homework_2.cpp        *
//*  ??????1200012884        * 
//*  ?????2012?10?29?      *
//*  ?????????????    *
//**********************************

int main()
{
	int n, a[100000], del, i, j;
	cin >> n;
	for (i = 0;i < n;i++)
		cin >> a[i];
	cin >> del;
	for (i = 0;i < n;i++)
	{
		if (a[i] == del)
		{
			for (j = i;j < n - 1;j++)	
				a[j] = a[j + 1];
			n = n - 1;
			i = i - 1;
		}
	}
	cout << a[0];
	for (i = 1;i < n;i++)
		cout << " " << a[i];
    return 0;
}
int main()//?????
{
     int d[100000],n,k,i,count=0;//?????n?k?i?????count
     cin>>n;//??n
     for(int i=0;i<n;i++)//??????
        cin>>d[i];
     cin>>k;//????????k
     for(int i=n-1;i>=0;i--)//?????????????????
         if(d[i]==k)  {
			for(int j=i+1;j<n;j++)   d[j-1]=d[j];
                        count++;

                       }
    if(count==n)  cout<<" "<<endl;//???????????
    else {
		cout<<d[0];//??d[0]
                for(int i=1;i<n-count;i++)//?1?n-1??????????
                cout<<" "<<d[i];
                cout<<endl;

	}
  
     return 0;//?????

}
int main()
{
	int a[100000];
	int n, i, j, l, u, num, k = 0;

	cin >> n;
	for(i = 0; i < n; i++)
		cin >> a[i];
	cin >> num;
	for(j = 0; j< n; j++)
	{
		if( a[j] == num)
		{	
		    k++;
			for(l = j; l < n - k; l++)
				a[l] = a[l + 1];
			j = j - 1;
			a[n - k] = num - 1;

		}

	}

	for(u = 0; u < n - k - 1; u++)
		cout << a[u] << " ";
	cout << a[n - k - 1];
	    return 0;
}
int main()
{
	int	n, i, k, j, sum = 0, p = 0, t;
	
	//??	
	cin >> n;
	int	a[n];
	for (i = 0; i < n; i ++)
	{
		cin >> a[i];
	}
	cin >> k;
	
	//???????k?????sum? 
	for (j = 0; j < n; j ++)
	{
		if (k != a[j])
		{
			sum ++; 
		}
	}
	
	//?????????????p < sum - 1??????????? 
	//???????????(p == sum - 1)????????? 
	for (t = 0; t < n; t ++)
	{
		if (k != a[t])
		{
			if(p == sum -1)
			{
				cout << a[t];
				p ++;
			}
			else
			{
				cout << a[t] << " ";
				p ++;
			}
		}
	}
	return 0;
}
void main()
{
	int i,j,n;
	long int k,a[100000];
	scanf("%d",&n);
	for(i=0;i<n;i++)
	{
		scanf("%ld",&a[i]);
	}
	scanf("%ld",&k);
	for(i=0;i<n;i++)
	{
		if(a[i]==k)
		{
			for(j=i;j<n;j++)
			{
				a[j]=a[j+1];
			}
			i=i-1;
			n=n-1;
		}
	}
	printf("%ld",a[0]);
	for(i=1;i<n;i++)
	{
		printf(" %ld",a[i]);
	}
}
/*
 * 1000012730_25.cpp
 *  ????????
 *  Created on: 2010-10-29
 *      Author: ???
 */

int main(){
	int n,i,k,m=0;                     //n?????????i??????k??????
	cin>>n;                            //??n
	int a[n];
	for(i=1;i<=n;i++)                  //??a[i]
		cin>>a[i];
	cin>>k;
	for(i=1;i<=n;i++)
	{
		if(a[i]==k)
		{
			for(int j=i;j<=n;j++)
				a[j]=a[j+1];
			i=i-1;
			m=m+1;                      //m???????????
		}
	}
	for(i=1;i<=n-m-1;i++)
		cout<<a[i]<<' ';
	cout<<a[n-m];
	return 0;
}
void main()
{
	int n,i,sum=0,j;
	scanf("%d\n",&n);
	int string[100000];
	int *p=string;
	for(i=0;i<n;i++)
		scanf("%d",p+i);
	int k;
	scanf("%d",&k);
	for(i=0;i<n;i++)
	{
		if(string[i]!=k)
		{
			printf("%d",*(p+i));
			break;
		}
	}
	for(j=i+1;j<n;j++)
	{
		if(string[j]!=k)
			printf(" %d",*(p+j));
	}
}
//* * * * * * * * * * * * * * * * * * * * * * * * 
//*????1000012839_3                         *
//*???? ????????                    *
//*?????                                   *
//*???2010.10.29                             *
//* * * * * * * * * * * * * * * * * * * * * * * * 
int main()
{
	int n, i, j, k, m;	//	i,j??????n???????????k??????????
	int a[100000];	//	?????
	cin >> n;	//	??n?
	for (i = 0; i <= n - 1; i++)
		cin >> a[i];
	cin >> k;
	for (m = 0, j = 0; m <= n - 1; m++)
	{
		if (a[m] != k)	//	??????k??
		{
			a[j++] = a[m];
			if (j != 1)
				cout << ' ' << a[j - 1];	//	????????????????????????
			else
				cout << a[j - 1];
		}
		
	}
	return 0;
}
/*
 * ????10.20.cpp
 * ?????
 * ????: 2011-10-20
 * ???????????
 */
int main(){
	int n,i=0,j,k,t;//????????????????????
	cin>>n;//?????????
	t=n;//???????n
	int a[100000];//????
	for (i=0;i<n;i++)
		cin>>a[i];//??????
	int m;//???????
	cin>>m;//???????
	i=0;
	while (i<=t)
	{j=i;
	    while (a[j]==m)//??????????
	    {j++;t--;}//????1
	    if (j-i)
	    {
		    for (k=i;k<n-(j-i);k++)
			a[k]=a[k+j-i]; //?????m?????k?
		    i=j;
        }
	    else i++;//?????
	}
	for (i=0;i<t-1;i++)
		cout<<a[i]<<' ';//?????
	cout<<a[t-1];//???????
    return 0;//????
}
int main()
{
	int a[100000], n, i, k, j = 0, s, m = 0;
	cin >> n;
	for (i = 0; i < n; i++)
	{
		cin >> a[i];
	}
	cin >> k;
	while (j < n - m - 1)
	{
		if (a[j] == k)
		{
			for (s = j; s < n - m - 1; s++)
			{
				a[s] = a[s + 1];
			}
			m++;
		}
		else
			j++;
	}
	if (a[n - m -1] == k)
		m++;
	cout << a[0];
	for (i = 1; i < n - m; i++)
	{
		cout <<' '<< a[i];
	}
	return 0;
}
void main()
{
	long int i,j,a[100000],*p,n,m,k;
	scanf("%d",&n);
	p=a;
	for(i=0;i<n;i++)
	{
		scanf("%d",p++);
	}
	p=a;
	scanf("%d",&k);
	for(i=0;i<n;i++)
	{
		if((*p)==k)
		{
			for(j=0;j<n-i-1;j++)
				*(p+j)=*(p+j+1);
			n=n-1;
			p--;
			i--;
		}
		p++;
	}
	p=a;
	for(i=0;i<n-1;i++)
	{
		printf("%d ",*p);
		p=p+1;
	}
	printf("%d",*p);
}
int main(){
    int a[100001];
    int n,k,i,j,l,num;
    scanf("%d",&n);
    for(i=1;i<=n;i++){scanf("%d",&a[i]);}
    scanf("%d",&k);
    num=0;
	for(i=1;i<=n;i++){
		if(a[i]!=k){num++;}
		}
	    i=1;
        j=0;
		while(1){
		if(j==num){break;}
		if(a[i]==k){
			for(l=i+1;l<=n;l++){a[l-1]=a[l];}
			a[n]=k;
			}
		else{j++;
		i++;
		continue;}
		j=0;
		i=1;
		}
	for(i=1;i<=num;i++){
		if(i==num){printf("%d",a[i]);}
		else{printf("%d ",a[i]);}
		}
	scanf("%d",&n);
	return 0;
}
void main()
{
	int n,i,j,k;
	int a[100000];
	
	scanf("%ld",&n);
	for(i=0;i<n;i++)
	{
		scanf("%ld",&a[i]);
	}

	scanf("%ld",&k);

	for(i=0;i<n;i++)
	{
		while(a[i]==k && n>i)
		{
			for(j=i+1;j<n;j++)			a[j-1]=a[j];
			n=n-1;
		}
	}
 
	for(i=0;i<n-1;i++)		printf("%ld ",a[i]);
	if(n>=0)				printf("%ld",a[n-1]);

}
int main()
{
	int n;
	cin>>n;
	int a[1000000];
	for(int i=0;i<n;i++)
	{
		cin>>a[i];
	}
	int k;
	cin>>k;
	int as=0,b=0,num=0;
	for(int i=0;i<n;i++)
	{
		if(a[i]==k)
		{
			as=b;
			b=i;
			num=num+1;
			if(num!=1 && (b-as)!=1)
			{
				for(int p=as+1;p<b;p++)
			      a[p+1-num]=a[p];
			}
		}
	}
	if( b!=(n-1) )
	{
		for(int i=b+1;i<n;i++)
		a[i-num]=a[i];
	}
	cout<<a[0];
	for(int i=1;i<n-num;i++)
	{cout<<" "<<a[i];}
	return 0;
}
/*
 * 1000012910_25.cpp
 *
 *  Created on: 2010-10-29
 *      Author: 10298
 */
int main(){
	int n,i,j,l,t=0,b,k;//????????t?????????
	cin>>n;//??n

	int a[n];//????
	for(i=0;i<n;i++)//
		cin>>a[i];//??????
cin>>k;//??????k
for(j=0;j<n-t-1;j++)//?????
{
	if(a[j]==k)//???a?j?????k
	{
		for(l=j;l<n-1;l++)//??????a?j?
			a[l]=a[l+1];//
		j=j-1;//?????????????
		t=t+1;//???????

	}

}
if(a[n-t-1]==k)//
	t=t+1;//????????k????????????????
	for(b=0;b<n-t-1;b++)//
		cout<<a[b]<<" ";//?????
	cout<<a[n-t-1]<<endl;//???????????????????????
	return 0;//

}
int main()
{
	int n,i,tn,j,k;
	cin>>n;
	int m[n];
	for(i=0;i<n;i++){                         //?????n???
		cin>>m[i];
	}

	cin>>tn;                                  //???????
	int I,N=n;                                //N??????tn?????????
	for(I=n-1;I>=1;--I){                      //???????tn
		if(m[I]==tn) N=N-1;
		else break;                           //??????tn,?????
		}

	k=N;                                      //k???????????????
	for(i=0;i<N;i++){
		if(m[i]==tn){
			k=k-1;
			for(j=i;j<k;j++) m[j]=m[j+1];     //???????????,k??
			i=i-1;
		}
	}


	for(i=0;i<k-1;i++){
		cout<<m[i]<<" ";                      //????tn????
		}
	cout<<m[k-1]<<endl;
	return 0;
}
int main(){
	int n;
	int i;
	int j;
	int d;
	int k;
	int max = 0;
    int f[100001];
	cin>>n;
	for(i=0;i<n;i++)
	{
		cin>>f[i];
	}
	cin>>k;
	for(i=0;i<n;i++)
	{
		if(f[i] == k)
		{
			for(j = i+1; j< n ; j ++)
			{
				f[j-1] = f[j];
			}
			i--;
			n--;
		}
	}
	for(i=0;i<n;i++)
	{
		if(i==0)
		{
			cout<<f[i];
		}
		else
		{
			cout<<" "<<f[i];
		}
	}
    
return 0;
}