semeru/Code-Code-CloneDetection-POJ104 huggingface dataset:
int main()
{
	int n, c, a[100000 + 10] = {0};
	int i, j;
	cin >> n;
	for (i = 0 ; i < n; i ++)
		cin >> a[i];
	cin>>c;
	for (i = 0; i < n; i ++)
	{
		if (a[i] == c)
		{
			for (j = i; j < n; j ++)
			{
				a[j] = a[j + 1];
			}
			n --;
			i --;
		}
	}
	int first = 1;
	for (i = 0; i < n; i ++)
	{
		if (first) {cout << a[i]; first = 0;}
		else cout << " " << a[i];
	}
	cout << endl;
	return 0;
		
}
/**
 * ? ? ??????????.cpp    
 * ?    ?????             
 * ?????2010?10?29?      
 * ???????????????????????????????????????
*/
int main()
{
	int n, k, i, j, m = 0, count = 0, a[100000];	//?????n??????????k?????????count??????????i?j??????
	cin>>n;									//?????????
		for ( i = 0; i < n; i++ )
		cin>>a[i];							//?????????
		cin>>k;									//????????
	for ( i = 0, j = 0; j < n; j++ )		
	{
		if ( a[j] != k )					//????????????????
			a[i++] = a[j];					//????????????????
		else 
			count++;						//???????????????
	}
	for ( j = 0; j < n - count; j++ )		//?????????????
	{
		if ( m != 0 )
		{
			cout<<" ";
		}
		cout<<a[j];
		m = 1;
	}
	cout<<endl;
	return 0;
}
int main()
{
    int n,i,del,j,m=0;
    cin>>n;
    int a[n];//??
    for(i=0;i<n;i++)
    {
        cin>>a[i];
    }
    cin>>del;//????del
    for(i=0;i<n;i++)
    {
        if(a[i]!=del&&m==1) {cout<<" ";m=0;}//???????m??
        if(a[i]!=del)
        {
            cout<<a[i];
            if(m==0) m=1;//m??????????
        }
        else{continue;}//?????????
        
    }

    return 0;
}
struct stu
{
char num[20];
int score;
struct stu * next;
};
struct stu *del(struct stu *head,int num)
{
 struct stu *p1,*p2;
p1=head;
for(;p1!=NULL;)    //??????16???p1->next??p1->next->next
{if (num!=p1->score)
p2=p1;
else
{if(p1==head) head=p1->next;
else p2->next=p1->next;
}
p1=p1->next;
}
return head;
}
struct stu *creat(int k)
{
	struct stu *head,*p1,*p2;
	int j=0;
	p1=p2=(struct stu *)malloc(sizeof(struct stu));
	head=NULL;
	while(j<k)
	{         scanf("%d",&p1->score);
	j++;
	if(j==1) head=p1;
	else p2->next=p1;
	p2=p1;
	p1=(struct stu *)malloc(sizeof(struct stu));
	}
        p2->next=NULL;
	return head;
}
void print(struct stu *head)
{
struct stu *p;
p=head;
while(p!=NULL)
{
printf("%d",p->score);
p=p->next;if(p!=NULL) printf(" ");
}
}
void main()
{
	struct stu *head;
	int n,k;
	scanf("%d",&n);
	head=creat(n);
	scanf("%d",&k);
	head=del(head,k);
	print(head);
}
int main()
{
	int num[100000] = {0};
	int n;
	cin >> n;
	for(int i = 0 ; i < n ; i++)
		cin >> num[i];
	int k;
	cin >> k;

	for(int i = 0 ; i < n ; i++)
	{
		while(num[i] == k)
		{
			for(int j = i ; j < n - 1 ; j++)
				num[j] = num[j+1];
			n--;					//???????????
			if(i >= n)
				break;
		}
	}
	cout << num[0];
	for(int i = 1 ; i < n; i++)
		cout << ' ' <<num[i];
	return 0;
}
//
// ????2.cpp
// ???????????
// ?????? 1200012943
// ??:2012.11.2
//
int main()
{
	int a[100000], k, n, j, i = 0;
	cin >> n;
	while (i < n)
	{
		cin >> a[i];
		i++;
	}
	cin >> k;
	i = 0;
	while (i < n)
	{
		if (a[i] == k)
		{
			if (i < n - 1)
			{
				j = i;
				while (j < n - 1)
				{
					a[j] = a[j + 1];
					j++;
				}
			}
				n--;
		}
		else
			i++;
	}
	for (j = 0; j < n; j++)
	{
		cout << a[j];
		if (j < n - 1)
			cout << ' ';
	}
	cout << endl; 
	return 0;
}
/*
 * 1000012761_25.cpp
 *???????????????????????????????????
?????????????????????????????
 *
 *  Created on: 2010-10-29
 *      Author: 1000012761
 */

int main(){
	int n,i,j,k,s=0;//?????? i j????  k??????? n???? s??????
	cin>>n;//?????
  if(n<0||n>100000) return 0;//?n????
int a[n];
	for(i=0;i<n;i++)//?????
	cin>>a[i];
	cin>>k;
	for(i=n-1;i>=0;i--){//???????
		if(a[i]==k){//???????
			s=s+1;//????s?1
			for(j=i;j<n-s;j++)//?????????
				a[j]=a[j+1];

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

	return 0;

}
int main()
{
	int n,i,j=0,k;
	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)
		{
 			a[j]=a[i];
            if(j==0)
			{
				printf("%d",a[j]);
			}
			if(j!=0)
			{
				printf(" %d",a[j]);
			}
			j++;

		}

	}	

}
int main ()
{
	int a[100005];
	int j=0,i,n,m;
	cin >>n;
    for (i=0;i<n;i++)
    {
		cin >>a[i];
    }
    cin >>m;
    for (i=0;i<n;i++)
    {
		if (a[i]!=m)
		j++;
    }
    i=0;
if(j==1)
{
for (i=0;i<n;i++)
{if (a[i]!=m)
{cout <<a[i]<<endl;
break;
}
}
}
else
{
    while (j>1)
    {
		
		if (a[i]!=m)
		{
		cout <<a[i]<<' ';
		j--;
		}
		i++;
    }
    for (i=n-1;i>0;i--)
    {
    if (a[i]!=m)
    {cout<< a[i] <<endl;
    break;
    } 
    }
}
    return (0);
}
//********************************
//*???????????   **
//*?????? 1200012988 **
//*???2012.10.30  **
//********************************


int main()
{
    int n, k, j = 0;
    cin >> n;
    int a[n];
    for(int i = 0; i < n; i++)
        cin >> a[i];
    cin >> k;
    while(j < n)
    {
        if(a[j] == k)
        {

            for(int m = j; m < n; m++)
                a[m] = a[m + 1];
            n--;
        }
        if(a[j] == k)
            j--;
        j++;
    }
    for(int l = 0; l < n; l++)
    {
        if(l < n - 1)
            cout << a[l] << " ";
        else
            cout << a[l];
    }

    return 0;
}
int main ()
{int n,b,c,d,e,f,g;
 scanf("%d",&n);
const int h=n;
int a[h];
for (b=0;b<=n-1;b++)
{scanf("%d",&a[b]);}
scanf("%d",&c);
f=0;
for(d=0;d<=n-1;d++)
{while (a[d]==c) {for(e=d;e<=n-2;e++)
{a[e]=a[e+1];
}
if (c!=0) a[n-1]=0; else a[n-1]=1;
f=f+1;}
}
for (g=0;g<n-f-1;g++)
{printf("%d ",a[g]);}
printf("%d",a[g]); 
return 0;
}
/*???1300062804*/
int main(){
	int i,n,k,b=0;
	int f[100000];//????????????????
	cin>>n;
	cout<<endl;
	for(i=1;i<=n;i++)
	cin>>f[i-1];//????????????
	cout<<endl;
	cin>>k;
	for(i=0;i<n;i++)
	{
		if(f[i]!=k)
                  {
b=b+1;
               if(b!=1)     
 cout<<" "<<f[i];//????????????????
else cout<<f[i];
	
}
}
return 0;
}
/**  
* @file   ???????? .cpp  
* @author ???  
* @date   2013-10-31
* @description 
*          ??????: ????????   */ 
int main ()
{
	int a[100001],num,c ;
	cin >> num ; 
	
    for (int i=0;i<num;i++)
	{
		cin >> a[i] ;
	}
	cin >> c ;
	for(int q=0 ;q<num;q++)
	{
		if(a[q]==c)
		{
			for(int p=q;p<num;p++)
			{
				a[p]=a[p+1];
			}
			num=num-1;
			q=q-1;
		}
	}
	for(int j=0;j<(num-1);j++)
	{
		cout << a[j] << " " ;
	}
	cout << a[num-1] ;
	return 0 ;
}
/*
 * ????shanchuyuansu.cpp
 * ?????????k????????????????????
 * ????: 2012-11-9
 * ??: ? ?
 */



int main()
{
	int n = 0;
	cin >> n;
	int a[n];
	int k = 0, i = 0, j = 0;
	int x = 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];
			}
			a[j] = -1234;
			i--;
		}
	}
	for ( i = 0; i < n; i++ )
	{
	 	if (a[i] != -1234)
	 	{
	 		if ( x == 1 ) cout << " ";
	 		x = 1;
	 		cout << a[i];
	 	}
	}
	cout << endl;
	return 0;
}
int main()
{
	struct number
	{
		int num,status;
	}
	a[100000];
	int n,i,k;
	int count;
	int j=0;
	scanf("%d",&n);
	count=n;
	for (i=0;i<n;i++)
	{
		scanf("%d",&a[i].num);
		a[i].status=1;
	}
	scanf("%d",&k);
	for (i=0;i<n;i++)
	{
		if (a[i].num==k)
		{
			a[i].status=0;
			count--;
		}
	}
	for (i=0;i<n;i++)
	{
		if (a[i].status && j!=(count-1))
		{
			printf("%d ",a[i].num);
			j++;
		}
		else
			if (a[i].status && j==count-1)
			{
				printf("%d",a[i].num);
			}
	}
	return 0;
}
int main()
{
	int buffer[200000];
	int NumOfBF;
	int NumToDelete;
	int NumofDel = 0;
	int i,j,k;
	scanf("%d",&NumOfBF);
	for(i = 0;i < NumOfBF;i++)
	{
			scanf("%d",&buffer[i]);
	}
	scanf("%d",&NumToDelete);
	for(j = 0;j < NumOfBF - NumofDel;j++)
	{
		if(buffer[j] == NumToDelete)
		{
		for(k = j;k < NumOfBF - NumofDel;k++)
		{
		buffer[k] = buffer[k + 1];
		}
		NumofDel++;
		j = j - 1; 
		}
	}
	printf("%d",buffer[0]);
	for(j = 1;j < NumOfBF - NumofDel;j++)
	{
	printf(" %d",buffer[j]);
	}
	printf("\n");
	return 0;
}
void main()
{
	int n,k,i,j,c=0,t,a[100000];
	scanf("%d",&n);
	for(i=0;i<n;i++)
		scanf("%d",&a[i]);
	scanf("%d",&k);
	t=a[n-1];
	if(t==k) a[n-1]+=1;    /*???????k????????*/
	for(i=0;i<(n-c-1);i++)
	{
		if(a[i]==k)
		{for(j=i;j<(n-1);j++) a[j]=a[j+1];
		    c+=1;i-=1;}
	}
	if(t!=k)
	 {for(j=0;j<(n-c-1);j++)
		printf("%d ",a[j]);
	 printf("%d",a[j]);}
	else if((t==k)&&(n>1))
	{for(j=0;j<(n-c-2);j++)
	   printf("%d ",a[j]);
	printf("%d",a[j]);}
}
int main()
{int n,m,i,j,k,a[100000];
	scanf("%d\n",&n);
	for (i=0;i<n;i++)
	{
		scanf("%d",&a[i]);
	}
	scanf("%d",&k);
	for (i=0;i<n-1;i++)
	{
		if (a[i]==k)
		{
			for (j=i;j<n;j++)
			{
				a[j]=a[j+1];
			}
			i--;
			n--;
		}
	}
	if (a[n-1]==k)
	{
		m=n-1;
	}
	else m=n;
	for (i=0;i<m-1;i++)
	{
		printf("%d ",a[i]);
	}
	printf("%d",a[m-1]);
	return 0;
}
/*
 * ArrayDelete.cpp
 *
 *  Created on: 2012-10-30
 *      Author: Cui Zhaoxiong Class4 1200012931
 */
int main() {
	int n = 0, k = 0, p = 0;
	cin >> n;
	int a[(const int) n];					//???n???
	for (int i = 0; i < n; i++) {			//???????
		cin >> a[i];
	}
	cin >> k;
	for (int i = 0; i < n; i++) {
		if (a[i] == k) {					//??????????????
			p++;							//???+1
			for (int j = i; j < n; j++) {	//??
				a[j] = a[j + 1];
			}
			i -= 1;							//?i???????
		}
	}
	cout << a[0];
	for (int i = 1; i < n - p; i++) {
		cout << ' ' << a[i];				//??
	}
}
void main()
{
        int n,k,i,j,a[100000],*p;
        scanf("%d",&n);
        for (i=0;i<n;i++)
        scanf("%d",&a[i]);
        scanf("%d",&k);
        p=a;
        for (i=0;i<n;i++)
        {
                if(*(p+i)==k)
                {
                        for(j=1;i+j<n;j++)
                        {
                                if(*(p+(i+j))!=k) {*(p+i)=*(p+(i+j));*(p+(i+j))=k;break;}
                        }
                }
                if(*(p+i)==k) break;
        }
        for (j=0;j<i-1;j++)
        printf("%d ",*(p+j));
        printf("%d",*(p+(i-1)));
}
//****************************************************** 
//* ? ? ?   ?? ? ? ? ? ? ? ?               *
//* ? ?      ?? ? ?                              *
//* ? ? ? ??2010 ? 10 ? 1 ?                    * 
//* ? ?      ?1000010185                            *
//****************************************************** 
int main()
{
	int n, a[100000], k, count = 0, j = 0; //??a???????count??a?k???
	cin >> n;
	for (int i = 0; i < n; i ++)
		cin >> a[i];
	cin >> k;

	//??j??k?????????????????i?????????k?????????????
	for (int i = 0; i < n; i ++)
		if (a[i] != k)
			a[j ++] = a[i];
		else
			count ++;
	cout << a[0]; //??????????a?????k??????????????k
	for (int i = 1; i < n - count; i ++)
		cout << ' ' << a[i];
	return 0;
}
void main()
{
	int n,m,i,j=0,k,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)
{
			for(k=i;k<n-1;k++)
			{
				j=a[k];
			    a[k]=a[k+1];
			    a[k+1]=j;
			}
			i--;
			n--;}
	}
	if(a[0]!=m)
		printf("%d",a[0]);
	for(i=1;i<n;i++)
	{
		if(a[i]!=m)
			printf(" %d",a[i]);
	}
	
}
int main ()
{
	int a[100000]={0},n,k,i=0,j,l=0;
	cin>>n;
	for(i=0;i<n;i++)
	{
		cin>>a[i];
	}
	cin>>k;
	for(j=0;j<n;j++)
	{
		if(a[j]==k)continue;
		else
		{
			l++;
			if(l==1)
			{
				cout<<a[j];
			}
			else
			{
				cout<<" "<<a[j];
			}
		}
	}





















	return 0;
}
int main()
{
	int n=0,i=0,k=0;//n?????????,i?????,??k?????
	int c=0;//c?????????????????
	cin>>n;
	int num[n];//??????
	for(i=0;i<=n-1;i++)
	{
		cin>>k;
		num[i]=k;
	}
	int del;//del??????
	cin>>del;
	for(i=0;i<=n-1;i++)
	{
		if(num[i]!=del)
		  c=i;
	}//??c??
	for(i=0;i<=c-1;i++)
	{
		if(num[i]!=del)
			cout<<num[i]<<" ";
	}//??num[c]????????
	cout<<num[c];//????c??????????
	return 0;
}
int main()
{
    int n,k,*p,*q,m,i,j,flag;
    int a[100001];
    p=&a[0];
    
    scanf("%d",&n);
    for(i=0;i<n;i++,p++)
        scanf("%d",&*p);
    scanf("%d",&k);
    p=&a[0];
    for(i=0;i<n;i++,p++)
    {
                          
    }
                        
    m=n;
    p=&a[0];
    for(i=0;i<=n;i++,p++)
    {
         if(p!=&a[0]&&*(p-1)==k)
         {
          p=p-1;
          i=i-1;
          j=j-1;                    
          }
                     
         if(*p==k)
         {
           q=p;
           for(j=i;j<n;j++,q++)    
              {
                *q=*(q+1);
                  
                
              }
           
           n=n-1;
           
           
          
           
          }
          
          
    }
    
    p=&a[0];
    for(i=0;i<n-1;i++,p++)
    {
     printf("%d ",*p);
    }
    printf("%d",*p);
}
/*????????????
**?  ????
**?  ??2010?10?29?
*/
int main()
{
	int n, i, j, k, m, count = 0, a[100001];
	cin >> n;
	for (i = 1; i <= n; i++)
		cin >> a[i];//????n??
	cin >> k;
	for (i = 1; i <= n - count; i++)
	{
		if (a[i] == k)
		{
			count++;//?a[i]????,???+1
			for (j = i+1; j <= n; j++)//??a[i]?????????
			{	
				if (a[j] == k)
				{
					count++;//???????,??+1
				}
				else 
				{
					for (m = i; m <= n - (j - i); m++)
					{
						a[m] = a[m + j - i];//?????????????,??????
					}
					break;//???a[j]???
				}
			}
		}
	}
	for (i = 1; i <= n - count; i++)
	{
		if (i < n - count) cout << a[i] << " ";//????????
		if (i == n - count) cout << a[i] << endl;//????????
	}
	return 0;
}
int main(){
	int n,i,k,r,sz[100000];
	scanf("%d",&n);
    for(i=0;i<n;i++){
		scanf("%d",&sz[i]);
		}
	scanf("%d",&k);
	for(i=0;i<n;i++){
		if(sz[i]==k){
			
			for(r=i;r<n;r++){
				sz[r]=sz[r+1];
				}
			i--;
			n--;
			}
		}
	
		
		
	for(i=0;i<n;i++){
		if(i==n-1){
			printf("%d",sz[i]);
			}
		else
		printf("%d ",sz[i]);
		}
	
	return 0;
	
	}
int main(void)
{
	int i,j,k=0;
	int n;
	int m;
	scanf("%d",&n);
	int a[n];
	for(i=0;i<n;i++)
	{
		scanf("%d",&a[i]);
	}
	scanf("%d",&m);
	for(i=0;i<n;)
	{
		if(a[i]==m)
		{
			for(j=i;j<n;j++)
			{
				a[j]=a[j+1];
			}
			k++;
		}
		else
		    i++;
		
	}
	for(i=0;i<n-k-1;i++)
	{
		printf("%d ",a[i]);
	} 
	printf("%d",a[n-k-1]);
	return 0;
}
int main()
{
	int n,i,j,k,counter=0;
	int num[110001];
	cin>>n;
	for(i=0;i<=110000;i++) num[i]=0;
	for(i=1;i<=n;i++) cin>>num[i];
	cin>>k;
	for(i=1;i<=n;i++)
	{
		if(num[i]==k)
		{
			for(j=i;j<=n-counter;j++)
			{
				num[j]=num[j+1];
			}
			counter++;
			i--;
		}
	}
	for(i=1;i<=n-counter-1;i++)
	{
		cout<<num[i]<<" ";
	}
	cout<<num[n-counter];
	return 0;
}
//
//	?????	????????
//	?????	???????????????????????????????????????????????????????????????? 
//	?????	?  ? ? ? ? ? 1000012733 ?
//	?????	2010 ? 10 ? 31 ?
//
int main()
{
	int i, j, k, n, count = 0, p;	//?????????????
	int a [ 100000 ];	//????a[100000]
    cin >> n;	//????????????
	for ( i = 0; i < n; i ++ )
		cin >> a [ i ];		//??????????
	cin >> k;	//?????????????????????
	for ( j = 0; j < n; j ++ )
	{
		if ( a [ j ] != k )		//?????????????????????????k
		{
			a [ count ] = a [ j ];	//???????k?????????????????????????
			count ++;	//??????????????count?1
		}
	}
	cout << a [ 0 ];	//???????a[0]????
	for ( p = 1; p < count ; p ++ )
	{
		cout << " " << a [ p ];		//?????????????????????????????????????????
	}
	return 0;
}
int main()
{
	int n,s=0,i,k,a[100000],b[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)
		{
			b[i]=0;
		}
		else
		{
			b[i]=1;
			s=s+1;
		}
	}
	for(i=0;i<n;i++)
	{
		if(b[i]==1)
		{
			if(s==1)
		    {
				printf("%d",a[i]);
			}
			else
			{
				printf("%d ",a[i]);
				s=s-1;
			}
		}
	}
	return 0;
}
void main()
{
long a,b=0,c=0,d=0,e,i,k,n,del,t,m,f,p,z,x;

scanf("%d",&n);
long q[100001];

{for(i=0;i<=n-1;i++)
scanf("%d",&q[i]);
}
scanf("%d",&del);
q[n]=q[n+1]=del;
d=0;
z=0,x=0;
t=1;
p=0;
 while(p<2500)
{p=p+1;
 i=0;
 while(i<n-1)
 {
    if(q[i]==del)
    {
    for(k=i;k<=n-1;k++)
    q[k]=q[k+1]; 
     i=i+1;
    }
    else
    i=i+1;   
 }



}
c=0;
printf("%d",q[c]);
c=c+1;

while((q[c]!=del)&&(c<n))
{
printf(" %d",q[c]);
c=c+1;
}

}
//*******************************
//* ????????????   ** 
//* ?????? 1300012948    ** 
//* ???2013.10.31           ** 
//*******************************
int main()
{
    int n, k, p, q;
    cin >> n;
    int a[n - 1];
    for(int i = 0; i <= n - 1; i++)               // ??????????? 
    {
          cin >> a[i];
    }
    cin >> k;                                     // ???????? 
    for(int i = 0; i <= n - 1; )                  // ??????????????????? 
    {
          if(a[i] == k)                           
          {
                  for(int m = i; m <= n - 1; m++)
                  {
                          a[m] = a[m + 1];
                  }
                  n--;
          }
          if(a[i] != k)                           
          i++; 
    }
    for(int i = 0; i <= n - 1; i++)              // ??????????????????????? 
    {
            if(i < n - 1)
            cout << a[i] << " ";
            else
            cout << a[i] <<endl;
    }
    return 0;
}
int main() {
	int n,k,sum=0;
    cin >> n;
    int shu[n];
    for(int i=0;i<n;i++)
    cin >> shu[i];
    cin >> k;
    for(int i=0;i<n;i++)
    {
      if(shu[i]==k)
      {
        sum=sum+1;
        for(int j=i;j<n;j++)
        {
          shu[j]=shu[j+1];
        }
        i=i-1;
      }
    }
    for(int i=0;i<n-sum;i++)
    {
      if(i==0)
      cout << shu[i];
      if(i>0)
      cout << " " <<shu[i];
    }
	return 0;
}
/*
 * delete numbers.cpp
 *
 *  Created on: 2012-11-5
 *      Author: Lsj
 */
int main() {
	int n, i = 0, p, k;//??n?i?p?k
	cin >> n;//?????????n
	p = n;//???p???n
	int a[n];//????
	for (i = 0; i < n; i++)
		cin >> a[i];//?????
	cin >> k;//???????k
	for (i = 0; i < n; i++) {
		if (a[i] == k)
			p -= 1;//???????????
	}
	for (i = 0; i < n; i++) {
		if (a[i] != k) {//????????
			p -= 1;
			if (p == 0)//???0??????????????
				cout << a[i];
			else
				cout << a[i] << " ";//??????????????
		}
	}
	return 0;
}//??
//i????? ??l????????? 
int main()
{
    int n=0,k=0;
    int a[100000];
    int i=0,j=0,l=0;
    cin>>n;
    for(i=0;i<n;i++){
                     cin>>a[i];
                     }
    cin>>k;
    i=0;
    while(a[i]!=k&&i<n)i++;
    while(i<n){
               while(a[i]==k){i++;j++;}
               a[i-j]=a[i];
               i++;
               }
    l=n-j;                
    for(i=0;i<l-1;i++)
       cout<<a[i]<<' ';
    cout<<a[l-1];                 
    return 0;                
     
}
int main()
	{
		int n,i,t,shan,p,s;
		
		scanf("%d",&n);
		s=n;
		int sz[100000];
		for(i=0;i<n;i++)
		{
			scanf("%d",&sz[i]);
		}
		scanf("%d",&shan);	
			 for(i=0;i<s;i++)
			{  
				if(sz[i]==shan)
				{
					t=sz[i];
					for(p=i;p<n;p++)
					{
						sz[p]=sz[p+1];
					}
					sz[n-1]=t;
					s--;
					i--;
				}	
			}
		
	
			for(i=0;i<s-1;i++)
			{
				
				printf("%d ",sz[i]);
				
			}
			printf("%d",sz[s-1]);
	
			return 0;
	}
int main()
{
    int a[100000];
    int n,k,i,j=0,l;
    int *p;
    scanf("%d",&n);
    for(i=0;i<n;i++)
    scanf("%d",&a[i]);
    scanf("%d",&k);
    p=a;
    for(i=0;i<n;i++)
       {
                    if(a[i]!=k)
       {
                  if(j!=0) printf(" %d",a[i]);
                  if(j==0) {printf("%d",a[i]);j++;}   
       }
       
       }
}
int main()
{
    int n,x;
    int a[N];
    int i,j,num;

    scanf("%d",&n);

    for(i=0;i<n;i++)
    {
        scanf("%d",&a[i]);
    }

    scanf("%d",&x);

    for(i=0,num=0;i<n-num;i++)
    {
        if(a[i]==x)
        {
            if(i==n-1-num)
            {
                num++;
            }
            else
            {
              for(j=i;j<n-num-1;j++)
              {
                a[j]=a[j+1];
              }
              i--;
              num++;
            }
        }
    }

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

    return 0;
}
int main()
{
	int n,a[100000] = {0},b[100000] = {0},k,i,j,l = 0,m;
	cin >> n;
	for(i = 0 ; i < n ; i++)
	{
		cin >> a[i];
	}
	cin >> k;
	for(j = 0;j < n;j++)
	{
    	if(a[j] != k)
		{
			b[l] = a[j];
			l++;
		}
	}
	for(m = 0;m < l-1;m++)
	{
		cout << b[m] << " ";
	}
	cout << b[l-1] <<endl;
	return 0;
}
int main ()
{int n,b,c,d,e,f,g;
 scanf("%d",&n);
const int gro=n;
int a[gro];
for (b=0;b<=n-1;b++)
{scanf("%d",&a[b]);}
scanf("%d",&c);
f=0;
for(d=0;d<=n-1;d++)
{while (a[d]==c) 
  {for(e=d;e<=n-1;e++)
   {a[e]=a[e+1];
 }
f=f+1;}
}
for (g=0;g<n-f-1;g++)
{printf("%d ",a[g]);}
printf("%d",a[g]); 
}
int main()
{
    int a[100010], n, k, num;
    cin >> n;
    for (int i = 0; i < n; i++)
    {
        cin >> a[i];
    }
    cin >> k;
    num = n;
    for (int i = 0; i < n; i++)
    {
        if (a[i] == k)
        {
            for (int j = i; j < num - 1; j++)
            {
                a[j] = a[j + 1];
            }
            a[num - 1] = k + 1;  //????k,???????,???.
            i--;
            num--;
        }
    }
    for (int i = 0; i < num - 1; i++)
    {
        cout << a[i] << " ";
    }
    cout << a [num - 1] << endl;

    return 0;
}
//*********************************
//****?????? 1200012772     *
//****???2012?11?2 ?        *
//****???????????      *
//*********************************

int main()
{
	int n = 0;  //n?????????(1<=n<=100000)
	cin >> n;    //????????? 
	int a[100001];     //????
	int i = 0;    //??i?????
	for (i = 0; i < n; i++) //????????
	{
		cin >> a[i];
	}
	int k;      //k?????????
	cin >> k;  //??k
	i = 0;
	int count =0, j = 0;  //count??????k???,j?????
	while (i < n)
	{
		if (a[i] == k)   //????????k????
		{
			for (j = i; j < n; j++)
			{
				a[j] = a[j+1];
			}
			count = count +1;   //??k???????
		}
		else
			i++;
	}
	
	for (i = 0; i < (n - count - 1); i++)
	{
		cout << a[i] << " ";     //????
	}
	cout << a[n - count - 1] << endl;   //????
	
	return 0;
}
void main()
{
long a,b=0,c=0,d=0,e,i,k,n,del,t,m,f,p,z,x;

scanf("%d",&n);
long q[100001];

{for(i=0;i<=n-1;i++)
scanf("%d",&q[i]);
}
scanf("%d",&del);
q[n]=q[n+1]=del;
d=0;
z=0,x=0;
t=1;
p=0;
 while(p<2500)
{p=p+1;
 i=0;
 while(i<n-1)
 {
    if(q[i]==del)
    {
    for(k=i;k<=n-1;k++)
    q[k]=q[k+1]; 
     i=i+1;
    }
    else
    i=i+1;   
 }
while(z<n-1)
{if(q[z]==del)
 x=x+1,z=z+1;
else
z=z+1;
}
if(x==0)
break;

}
c=0;
printf("%d",q[c]);
c=c+1;

while((q[c]!=del)&&(c<n))
{
printf(" %d",q[c]);
c=c+1;
}

}
void main()
{
	int n,i,k,a[100000],*p,*q;
	scanf("%d",&n);
	for(i=0;i<n-1;i++)
		scanf("%d ",&a[i]);
	scanf("%d",&a[n-1]);
	scanf("%d",&k);
	p=a;
	for(i=0;i<n;i++,p++)
	{
		if(*p==k)
		{
			for(q=p;q<a+n;q++)
				*(q)=*(q+1);
			i--;
			n--;
			p--;
		}
	}
	p=a;
	printf("%d",*p);
	for(i=1;i<n;i++)
		printf(" %d",*(p+i));

}
/*
 * 123.cpp
 *
 *  Created on: 2011-10-21
 *      Author: 11061
 */
int main()
{
	int n,k,i,j,l,m,count=0;
	cin>>n;
	int a[100001];
	for(i=0;i<=n-1;i++)
		cin>>a[i];
	cin>>k;
	j = 0;
	while(j < n){
		while(a[j] == k && j <= n-1){
			for(l = j; l <= n-2; l++){
				a[l] = a[l+1];
			}
			n --;
		}
		j ++;
	}

	for(m=0;m<=n-2;m++)
		cout<<a[m]<<' ';
	cout<<a[m];

	return 0;
}
int n , k;
int a[100009] ;

int main () {
	cin >> n ;
	for (int i = 1 ; i <= n ; ++i) {
		cin >> a[i] ;
	}
	cin >> k ;
	
	for (int i = 1 ; i <= n ; ++i) {
		if (a[i] == k) {
			memmove (&a[i] , &a[i+1] , (n-- - i) * sizeof (*a)) ;
			--i ;
		}
	}
	
	for (int i = 1 ; i <= n ; ++i) {
		cout << a[i] << (i == n ? '\n' : ' ') ;
	}
}
int main()
{
	int num[100001], size, i, r, k, del;
	cin >> size;
	for (i = 1; i <= size; i++)
	{
		cin >> num[i];
	}
	cin >> del;
	for (i = 1; i <= size; i++)
	{
		if (num[i] == del)
		{
			size--;
			for (r = i; r <= size; r++)
			{
				num[r] = num[r + 1];
			}
			i--;
		}
	}
	for (i = 1; i <= size; i++)
	{
		cout << num[i];
		if (i == size)
		{
			cout << endl;
		}
		else 
		{
			cout << " ";
		}
	}
	return 0;
}
//***************************************************
//*******      ??5_5???????.cpp      *******
//*******      ???1000012895               *******
//*******      ??????                   *******
//*******      ???2010/10/27               *******
//***************************************************
int main()
{
	int n, a[100000], k, i, r, t = 0;
	cin >> n;
	for(i = 0; i < n; i++)
		cin >> a[i];
	cin >> k;
	for(i = n - 1; i >= 0; i--)
		if(a[i] == k)
		{
			t++;
			for(r = i; r < n - 1; ++r)
				a[r] = a[r+1];
		}
		for(i = 0; i < n - t - 1; ++i)
			cout << a[i] << ' ';
			cout << a[n - t - 1];
	return 0;
}