semeru/Code-Code-CloneDetection-POJ104 huggingface dataset:
//*******************************
//???????
//??????1200012798
//??? 2012.11.4
//******************************* 


int main()
{
	int n,k;
	int num[100000];
	int count=0;

	cin >> n;
	for (int i = 0; i <= n - 1; i++) 
	{
		cin >> num[i];
	}
	cin >> k;
	for (int j = 0; j <= n-1-count; )
	{
		if (num[j] == k)
		{
			for (int l = j; l <= n - 2 - count; l++)
			{
				num[l] = num[l + 1];
			}
			count++;
		}
		else
		{
			j++;
		}
	}
	cout << num[0];
	for (int m = 1; m <= n-1-count; m++)
	{
		cout << " " << num[m];
	}

	return 0;
}
int main()
{
	int a[100000],i,n,k,*p,j;
	scanf("%d",&n);
	for(p=a;p<(a+n);p++)
	{
		scanf("%d",p);
	}
	scanf("%d",&k);
	for(i=0;i<n;i++)
	{
		if(a[i]==k)
		{
			for(p=a,j=i;j<n-1;j++)
			{
				*(p+j)=*(p+j+1);
			}
			i=i-1;
			n--;
		}
	}
	for(p=a;p<(a+n-1);p++)
	{
		printf("%d ",*p);
	}
	printf("%d",a[n-1]);
	return 0;
}
main()
{
	int a[100000],k,i,j,n,m=0,*p=a;
	scanf("%d",&n);
	for(i=0;i<n;i++)
		scanf("%d",&a[i]);
	scanf("%d",&k);
    for(i=n-1;i>=0;i--)
		if(*(p+i)==k)
		{
			for(j=i;j<n-1;j++)
				*(p+j)=*(p+j+1);
			m+=1;
		}
	for(i=0;i<n-m-1;i++)
		printf("%d ",*(p+i));
	printf("%d\n",*(p+i));
}
/*
 * 2222.cpp
 *
 *  Created on: 2011-10-21
 *      Author: 11281
 */
int main()
{
	int n,b,c,i,j,q,k=0,s;
	cin>>n;
	int a[n];
	for(j=0;j<n;j++)
	{cin>>b;
	a[j]=b;
	}
	cin>>c;
	for(i=0;i<n;i++)
	{if(a[i]==c)
		{k=k+1;
	for(q=i+1;q<=n;q++)
	{a[q-1]=a[q];
	}
	i=i-1;}
	else
		continue;}
	for(s=0;s<n-k-1;s++)
	{cout<<a[s]<<" ";
}
	cout<<a[n-k-1]<<endl;
return 0;
}
int main()
{
	int a[100000], n, i, k, j;
	cin >> n;
	for (i = 0; i < n; i++)
		cin >> a[i];
	cin >> k;
	for (i = 0; i < n; i++)
	{
		if (a[i] == k)
		{
			n -= 1;
			for (j = i; j < n; j++)
			{
				a[j] = a[j+1];
			}
			i -= 1;
		}
	}
	for (i = 0; i < n; i++)
	{
		if (i != 0)
			cout << " ";
		cout << a[i];
	}
	return 0;
}
int main()
{
	int i,a[100001],n,k,x;
    cin>>n;
	for(i=0;i<n;i++)
		cin>>a[i];
	cin>>k;
	for(i=0;i<n;i++)
	{
	if(a[i]==k)
	a[i]=172486;
	}
    for(i=0;i<n;i++)
	{
	if(a[i]!=172486)
	{cout<<a[i];
	x=i;break;}
	}
	for(i=x+1;i<n;i++)
{if(a[i]!=172486)
cout<<" "<<a[i];}
		cin.get();
		return 0;
}
int main(int argc, const char * argv[])
{
    int a[100000]={0};//??
    int n;//??????
    cin >> n;
    for(int i=0;i<n;i++)
        cin >> a[i];
    int k;
    cin >> k;
    int lenth=n;//??????
    for(int i=0;i<n;i++)
    {
        if(a[i]==k)
        {
            for(int j=i;j<n-1;j++)//??????????????????????????lenth--
                a[j]=a[j+1];
            a[n-1]=k+1;//???????????k+1,????????k
            lenth--;
            i--;//???????????????????????????
        }
    }
    for(int i=0;i<lenth;i++)
    {
        cout << a[i];
        if(i!=lenth-1)
            cout << " ";
    }
    cout << endl;
    return 0;
}
int main(void)
{
	int a[100000],length;     
	int n,k,i,j;
	scanf("%d",&n);
    length=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;j<n-1;j++)
				a[j]=a[j+1];
			i--;
			n--;
		}
	}
         printf("%d",a[0]);
	for(i=1;i<n;i++)
		printf(" %d",a[i]);
	printf("\n");
	return 0;
}
int main()
{
int a[100000],i,j,n,k,*p=a;
scanf("%d",&n);
for(i=0;i<n;i++)
	scanf("%d",&a[i]);                                //*p?????????
scanf("%d",&k);
p=a;
for(i=n-1;i>=0;i--)
{
	if(*(p+i)==k)                                       //????????????????????
	{
		for(j=i;j<n;j++)
		{
			*(p+j)=*(p+j+1);
		}
		n--;
	}
	                                                   //??????????????????
}
p=a;
for(i=0;i<n-1;i++)
{
	printf("%d ",*(p+i));
}
printf("%d",*(p+n-1));
return 0;
}
int main(){
	int shu[100000];
	int i,j,n=0,shan,shuru,a;
	scanf("%d",&shuru);
	for(i=0;i<shuru;i++){
		scanf("%d",&a);
		shu[i]=a;
	}
	scanf("%d",&shan);
	if(shuru==1){
		if(shu[0]==shan){
			n=0;
		}
		else{
			n=1;
		}
	}
	if(shuru!=1){
	  for(i=0;i<shuru;i++){
		 if(shu[i]==shan){
			for(j=i;j<shuru-1;j++){
				shu[j]=shu[j+1];
				
			}
			i=i-1;
			shuru=shuru-1;
		}
		else{
				n=n+1;
			}
	}
	}
	if(n!=0){
	for(i=0;i<n;i++){
		if(i==n-1){
		    printf("%d",shu[i]);
		}
		else{
			printf("%d ",shu[i]);
		}
	}	
	
	}
   return 0;
}
//???????????//
//??????//
//???2010.10.27//

int main()
{
	int n = 0;
	int a[100002] = {0};             //????a[100002]//
	int k = 0;
	int i = 0;
	int j = 0;
	int count = 0;                   //?????count??????????//
	int f = 0;                       //??f?????????//

	cin >> n;
	for (i = 1; i <= n; i ++)
		cin >> a[i];
	cin >> k;

	for (i = 1; i <= n; i ++)
	{
		if (a[i] == k)
		{
			for(j = i; j <= n; j ++)  //??????????//
				a[j] = a[j + 1];
			count ++;                 //????1//
			i --;                     //????a[i]//
		}
	}

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

	return 0;
}
//*****************************************
//* ??????????? **
//* ?????? 1300012741 **
//* ???2013.10.30 **
//*****************************************


int main()
{
	int list[100000];
	int i, num, target; // ????????????????????
	int move = 0; // ??????
	int space_check = 0; // ????????

	cin >> num;

	for ( i = 0; i < num; i++ ) // ????
		cin >> list[i];

	cin >> target;

	for ( i = 0; i < num; i++ ) // ??????
	{
		if ( target != list[i] ) // ?????
		{
			list[i - move] = list[i];
			if ( space_check ) // ????
				cout << " ";
			else
				space_check = 1; 
			cout << list[i];
		}
		else
		{
			move++;
		}
	}

	return 0;
}
//********************************
//*??????????? **
//*????? 1300012839 **
//*???2013.10.31**
//********************************
int main()
{
	int a[100000];
	int i,j,n,out,count = 0,flag = -1;                 //i,j??????out??????,??flag????
	cin >> n;                                          //?????n
	for(i = 0;i < n;i++)
		cin >> a[i];                                   //?????
	cin >> out;                  
	for(i=0;i < n;i++)
	{
		if(a[i] != out)
	    {
			count = count+1;                          //????out?????
		    flag = i;                                 //flag???????out?????
		}
	}
	for(j = 0;j < flag;j++)
		if(a[j] != out)cout << a[j] << " ";          //????count-1?????
	if(flag!=-1)cout << a[flag]<< endl;              //?flag?=-1??????????out??????????????????
	return 0;
}
int main()
{
    int i=0,p,k,b,n,j=0,t;
	cin>>n;
	int a[100000]={0};
	for (p=0;p<=n-1;p++)
	{
		cin>>a[p];
	};
	cout<<endl;
	cin>>b;
	for (t=0;t<=n-1;t++)
	{
		if (a[t]!=b)
		break;
	} 
	for (i=t+1,j=t+1;j<=n-1;j++)
	{
		if (a[j]!=b)
		{
			a[i]=a[j];
			i++;
		}
	}
		cout<<a[t];
	
	for (k=t+1;k<=i-1;k++)
	{
		cout<<" "<<a[k];
	}
	return 0;
}
/*
 * 00948344_25.cpp
 * ????????????????????
 * Created on: 2010-10-30
 * Author: 00948344 ??
 */

int main(){
	int n;                //??????????
	cin>>n;
	int *p=(int*)malloc(n*sizeof(int));   //????
	int i;                     
	for(i=0;i<n;i++)                      //???????
	cin>>p[i];
	int k;                                //?????????
	cin>>k;
	for(i=0;i<n;i++)                     //????????????????????????????
		if(p[i]==k)
		{
			n--;                         //?????
			for(int j=i;j<n;j++)
		            p[j]=p[j+1];
			i--;
		}
    if(n==0)                             //????????????none
    	cout<<"none";
    else                                 //?????????????
    {
    	cout<<p[0];
    	for(i=1;i<n;i++)
    	cout<<' '<<p[i];
    }
    free(p);                             
    return 0;                            //????
}
main()
{
   long n,k,i,j,m=0,t;
   long a[100000],*p,*q;
   scanf("%ld",&n);
   for(i=0;i<n;i++)
      scanf("%ld",&a[i]);
   scanf("%ld",&k);
   p=a;q=a;
   for(p=a;p<a+n;p++)
   {
      if(*p==k)
      {
		 m++;
         for(q=a;q<=p;q++)
         {
            t=a[0];
            a[0]=*q;
            *q=t;
         }
      }
   }
   for(p=a+m;p<a+n-1;p++)
      printf("%ld ",*p);
   printf("%ld",*(a+n-1));
}
int main()
{
	int sum=1,j,i,k=0,n,m,a[101001]={0};
    cin>>n;
	for(i=1;i<=n;i++)
	{
		cin>>a[i];
	}
	cin>>m;
	for(i=1,j=1;j<=n;j++)
	{

		   if(a[j]!=m)
		        a[i++]=a[j];
	

	}

	
	for(k=1;k<=i-1;k++)
    {
		if(k==1)
		{
			cout<<a[k];
		}
		else
		{
			cout<<" "<<a[k];
		}
	}
		  
	
    
	return 0;
}
/*
 * 1000012861_25.cpp
 *  Created on: 2010-10-23
 *      Author: ??
 *      ???????????
 */


int main(){int m,n,i,num,j,r;
    cin>>m;
    n=m;
	int a[n] ;
	for(i=0;i<n;i++)
	cin>>a[i];
	cin>>num;
	for(i=0;i<n;i++)
	if(a[i]==num){
		for(j=i;j<n;j++)
		a[j]=a[j+1];
	i=i-1;
	n=n-1;}

	for(i=0;i<=n-2;i++)
	cout<<a[i]<<" ";
	cout<<a[i];
    return 0;
}
int main()
{
	int n,k,i;
	cin>>n;//??n 
	int a[n];
	for(i=0;i<n;i++)//??a[n] 
		cin>>a[i];
	cin>>k;//??????? 
	int m=0,j;
	for(i=0;i<n-m;i++)
		if(a[i]==k)
			{for(j=i;j<(n-1-m);j++)
				a[j]=a[j+1];
				m++;
	           i--;}
				
	for(i=0;i<(n-m-1);i++)
		cout<<a[i]<<' ';
cout<<a[n-m-1];
  cin.get(); cin.get(); cin.get();
	return 0;
}
//****************************************
//*???????????               **
//*????? 1100012780     	        **
//*???2011.10.23                     **
//****************************************
int main()
{
	int n;//?????????n
	cin>>n;
	int a[100000],k,i,j,count = 0;//??a[100000]??????k?????i,j,count??????????
	for (i = 0;i < n;i++)
	{
		cin>>a[i];
	}
	cin>>k;
	for (i = n - 1;i >= 0;i--)
	{
		if (a[i] == k)
		{
			count++;
			if (i != n - 1)
			{
				for (j = i;j < n - 1;j++)
				{
					a[j] = a[j + 1];
				}
			}
		}
	}
	for (i = 0;i <= n - 1 - count;i++)
	{
		if (i != n - 1 - count)
			cout<<a[i]<<" ";
		else
			cout<<a[i];
	}
	return 0;
}
int main()
{
	int n,i,j,k,l=0;//????n?????ij?????k????k???l
	int a[100001];
	cin>>n;
	for(i=1;i<=n;i++)
		cin>>a[i];//??
	cin>>k;
	for(i=1;i<=n-l;i++)
		if(a[i]==k)
		{
			l++;
			for(j=i;j<=n-l;j++)
				a[j]=a[j+1];//??k???
			i--;
		}
	for(i=1;i<=n-l-1;i++)
		cout<<a[i]<<' ';
	cout<<a[n-l];//??
	return 0;
}
//*******************************************
// ?? ?2.cpp                             *
// ?? ???? 1200012925                 *
// ?? ?10?30?                          *
// ?? ?????????????          *
//*******************************************
int main()
{
//??????????n ???????s[]??
//????? shan ?????
	int n, m, s[100000], shan, i, j;
	cin >> n;                 //???????
	m = n;
	for(i = 0 ; i < n ; i ++) //????
	{
		cin >> s[i];
	}
	cin >> shan;              //????????
//????????????????????
	for(i = 0; i < n; i ++)
	{
		if(shan == s[i])
		{
			for(j = i ; j < n - 1 ; j ++)
			{
				s[j] = s[j + 1];
			}
			n --;
			i --;              //?????????????
		}
	}
//????????????? ?????? ????
	for(i = 0 ; i < n - 1 ; i ++) 
	{
		cout << s[i] << " ";
	}
	cout << s[n - 1];
	return 0;
}
//10?28????????????????????1000012899?
int main()
  {
    int n, k, a[100001], i, j, m;
    cin >> n;
    for (i = 1; i <= n; i ++) cin >> a[i];
    cin >> k;
    m = n;
   i = 1;
    while (i <= m )
     {
        while(a[i] == k)
          {
             for (j = i; j <= m; j ++) a[j] = a[j+1];
             m = m - 1;
           }
        i ++;
      }
    cout << a[1];
    for (i = 2; i <= m; i ++) cout << ' ' << a[i];
    return 0;
  }
int main(){
    int a[100000],*p,i,j,n,k,sum;
    scanf("%d",&n);
    for(i=0;i<n;i++){
        scanf("%d",&a[i]);
    }
    scanf("%d",&k);
    sum=n;
    p=a;
    for(i=0;i<sum;i++){
        if(a[i]==k){
            
            for(j=i;j<sum;j++){
                *(p+j)=*(p+j+1);

            }
i=i-1;
            sum=sum-1;
        }
    }
    p=a;
    for(i=0;i<sum;i++){
        printf("%d",*(p+i));
        if(i!=sum-1) printf(" ");
    }
    printf("\n");
}
/* ????main.cpp
 * ??????
 * ?????2012-10-29
 * ?????????????????????????????????????? 
 * ????????????????????????????? 
 */

int main ()
{
	int n,a[100000],k,i,j;//????n,k???a?????i?j
	j = 0;//???j?0
	cin >> n;
	for ( i = 0; i < n; i++ )
		cin >> a[i];//?????????
	cin >> k;
	for ( i = 0; i < n; i++ )
		if ( a[i] != k )//?a[i]???k????????????a????a?????
		{
			a[j] = a[i];
			j = j + 1;
		}
	cout << a[0];//???????
	if ( j > 1 )
		for ( i = 1; i <= j - 1; i++ )
			cout << " " << a[i];
	cout << endl;
	return 0;
}
int main()
{
    
    int n,i,j,b;
    cin>>n;
    int a[n];
    for(i=0; i<n; i++)
        cin>>a[i];
    
    cin>>b;
    
    for(i=0;i<n;i++){
        if (a[i]==b){
            for(j=i;j<n-1;j++)
                a[j]=a[j+1];
            n--;
            i--;
        }
    }
    
    for(i=0; i<n-1; i++)
        cout<<a[i]<<" ";
    cout<<a[n-1];
    return 0;
}
main()
{
      long int a[100000],b,c,m,n,i,t,j,e=0,p;
      scanf("%d",&n);p=n;
      for(i=0;i<n;i++)
      scanf("%d",&a[i]);
      scanf("%d",&m);
      for(c=0;c<n;c++)
      {if(a[c]==m)e++;}
      
      for(c=0;c<=e;c++)
      {for(i=0;i<n-1;i++)
      {if(a[i]==m) 
           {a[i]=a[i+1];a[i+1]=m;}
      }}
      if(n-e-1>0)
      {for(i=0;i<n-e-1;i++)
      {printf("%d ",a[i]);}printf("%d",a[n-e-1]);}
      if(n-e-1==0)printf("%d",a[n-e-1]);
      getchar();getchar();getchar();
}
int main()
{
	int a[100000]={0}, i, t, n, k, count=0;
	cin >> n;
	for(i = 0; i < n;i++)
		cin >> a[i];
	cin >> k;
	for(i = 0, t = 0;t<n;t++)
	{
		if(a[t]!=k)
		{
			a[i] = a[t];
			i++;
		}		
		else 
			count++;
	}
	cout << a[0];
	for(i = 1;i < (n - count);i++)
		cout << " " << a[i];
	return 0;
}
/*
 *???ss.cpp
 *???????????
 *??: 2012-10-31
 *?????1200012825
 */

int main(){
	int n,i,j,s,t,m,del,x,sum=0;//del???????sum???????n??????????
	cin>>n;
	int num[100001];
	for(i=0;i<=n-1;i++){
		cin>>num[i];//?????
	}
	cin>>del;
	for(x=0;x<=n-1;x++){
			if(num[x]==del){
				sum=sum+1;//?????????
			}
		}
	for(j=n-1;j>=0;j--){
		if(num[j]==del){
			for(s=j;s<=n-1;s++){
				num[s]=num[s+1];//???????????????
			}
		}
	}
	cout<<num[0];
	for(t=1;t<=n-sum-1;t++){
		cout<<" "<<num[t];//????
	}
	return 0;
}
void main()
{
	int a[100001],n,i,j,x,m,t;
	scanf("%d\n",&n);
	for(i=0;i<n;i++) scanf("%d",&a[i]);
	a[n]=0;
	scanf("%d\n",&x);
	for(m=0,i=0;i<n;i++) 
		if(a[i]==x) 
		{
			t=i;
			for(j=t;j<n;j++) a[j]=a[j+1];
			m++;
			i--;
		}
	for(i=0;i<n-m-1;i++) printf("%d ",a[i]);
	printf("%d\n",a[n-m-1]);
}
void main()
{
	int a[100010],num,i,j,k,move;
	scanf("%d",&num);
	for (i = 0;i < num;i++)
		scanf("%d",&a[i]);
	scanf("%d",&k);
	move = 0;
	for (i = 0;i < num;i += 1)
	{
		if (a[i] == k)
{
			for (j = i;j < num - 1;j += 1)
				a[j] = a[j + 1];
			i -= 1;
			num -= 1;
		}
	}
	for (i = 0;i < num - 1;i += 1)
		printf("%d ",a[i]);
	printf("%d\n",a[num - 1]);
}
int main()
{
    int n, k, i, m, t;
    int a[100001];
    cin >> n ;
    for( i = 1; i <= n ; i++)
    {
          cin >> a[i] ; 
    }
    cin >> k; 
    t = 0; 
    for( i = 1; i <= n; i++)
    {
         if (a[i] == k)
         t = t + 1;
         else
         a[i-t]=a[i];
    }
    cout << a[1];
    for( i = 2; i <= n - t; i++)
    {
         cout << " " << a[i] ;
    }  
    cin >> n;
    return 0;
}
void main()
{
	int i,n,del;
	struct p{
		int num;
		struct p *next;
	};
	struct p *p1,*p2,*head;
	scanf("%d",&n);
	for(i=0;i<n;i++){
		p1=(struct p*)malloc(LEN);
		scanf("%d",&(p1->num));
		if(i==0)head=p1;
		else p2->next=p1;
		p2=p1;
	}
	p1->next=NULL;
	scanf("%d",&del);
	for(p2=p1=head;p1!=NULL;p1=p1->next){
		if(p1->num==del){
			if(p1==head)head=p2=p1->next;
			else p2->next=p1->next;
		}
		else p2=p1;
	}
	for(p1=head;p1!=NULL;p1=p1->next)printf("%d%c",p1->num,p1->next==NULL?'\n':' ');
}
//****************************************************************
// ????1000012789_2.cpp                                      *
// ???wusy                                                    *
// ???10?27                                                  *
// ???????????                                        *
//****************************************************************
int main()
{
	int n, a[100001], k, q, count1 = 0, count2 = 0;     //????????????
	cin >> n;                                           //count1?count2,q????

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

	if(a[0] != k)                                       //??1???k????a[0]
	{
		cout << a[0];

		for(int j = 1; j <= n-1; j++)                   //??????k??
		{
			if(a[j] == k)                               //???
			{
				for(int e = j; e <= n-1; e++)             //????????
				a[e] = a[e+1];

				count1 ++;                              //????1
				j -- ;                                  //j-1?????
			} 
		}
			for(int f = 1; f <= n-count1-1; f++)        //????????n-count1-1
				cout << " " << a[f];
	}

	if(a[0] == k)                                       //??1??k?
	{
		for(int m = 1; m <= n-1; m++)                   //?????????????k
		{
			if(a[m] != k)                               //??k?
			{	
				q = m;
				break;                                  //q???????
			}
		}
		cout << a[q];                                   //??a[q]

		for(int t = q+1; t <= n-1; t++)                 //???a[0]!=k???,????          
		{
			if(a[t] == k)                               
			{
				for(int h = t; h <= n-1; h++)             
					a[h] = a[h+1];

					count2 ++;
					t -- ;
			}
		}
		for(int o = q+1; o <= n-count2-1; o++)          //??????n-count2-1
			cout << " " << a[o];
	}
	return 0;
}
void main()
{
 long int n,m,i,j=0;
 long int a[100001];
 long int *p,*q,*o;
 scanf("%ld",&n);
 for(p=a;p-a<n;p++)
 scanf("%ld",p);
 scanf("%ld",&m);
 for(p=a;p-a<n-j;)
 {if(*p==m) 
   {for(q=p+1;q-a<n;q++)
    *(q-1)=*q;
    j++;}
  else p++;}  
 for(p=a;p-a<n-j-1;p++)
 printf("%ld ",*p);
 printf("%ld",*p);
}
/*
 * 1.cpp
 *
 *  Created on: 2013-10-20
 *      Author: ??
 */
int main(){
	      int n,k,i,a[100000];
	      cin>>n;
	      for(i=0;i<n;i++){
	         cin>>a[i];
	      }
	      cin>>k;
	      if(a[0]==k){
	    	  for(i=1;i<n;i++) if(a[i]!=k) {a[0]=a[i];a[i]=k;break;}
	      }
	      cout<<a[0];
	      for(i=1;i<n;i++){
	    	  if(a[i]!=k) cout<<" "<<a[i];
	      }
	      return 0;
}
//********************************
//*???????k?     **
//*?????? 1200012839 **
//*???2012.10.30   **
//********************************

int main()
{
    int n, k, c=0;
    cin >> n;
    int a[n];
    for (int i = 0; i < n; i++)
    {
        cin >> a[i];
    }
    cin >> k;
    for (int i = 0; i < n; i++)
    {
        while (a[i] == k)
        {
            for (int j = i; j < n; j++)
            {
                a[j] = a[j+1];
            }
            c++;
        }
    }
    cout << a[0];
    for (int i = 1; i < n - c; i++)
    {
        cout << " " << a[i];
    }
    return 0;
}
int main()
{
    
    int i,k,n,p,j;
	int a[1000000];
	scanf("%d",&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+1;j<n;j++)
			{
				if(*(a+j)!=k)
				{
					*(a+i)=*(a+j);
				    *(a+j)=k;
					break;
				}
			}
		}
	}
	for(i=n-1;i>=0;i--)
	{
		if(*(a+i)!=k)
		{
			p=i;
			break;
		}
	}
	for(i=0;i<=p;i++)
	{
		if(i<p)
		printf("%d ",*(a+i));
		if(i==p)
        printf("%d",*(a+i));
	}
	return 0;
}
int main()
{
	int b,i,c,d,n,e,j,k,m,a[1000000];
	scanf("%d",&n);

	for(i=1;i<=n;i++){
		scanf("%d",&a[i]);
	}
	scanf("%d",&b);
	for(k=1;k<=n;k++){
		if(a[k]!=b){
				printf("%d",a[k]);
		break;
		}
	}

	for(j=k+1;j<=n;j++){
			if(a[j]!=b)printf(" %d",a[j]);
	}

	return 0;
}
int main()
{
    int a[100000];
    int n;
    int a1,a2,a3,a4,a5;
    int c;
    int b;
    int k;
    cin>>n;
    for(a1=0;a1<n;a1++)
    {
        cin>>a[a1];
    }
    cin>>k;
    for(a2=n-1;a2>=0;a2--)
    {
        if(a[a2]!=k)
        break;
    }
    for(b=0,a3=a2;a3>=0;a3--)
    {
        if(a[a3]==k)
        {
            b=b+1;
        }
    }
    for(c=0,a4=0;a4<=a2;)
    {
        if(a[a4]!=k)
        {
            a[c]=a[a4];
            c++;
            a4++;
        }
        else
        {
            a4++;
            continue;
        }
    }
    for(a5=0;a5<=c-1;a5++)
    {
        if(a5!=c-1)
        cout<<a[a5]<<" ";
        if(a5==c-1)
        cout<<a[a5];
    }
    return 0;
}
/**
 * @file   2.cpp
 * @author ???
 * @date   2013-10-30
 * @description
 *         ?????????(11-4) ????????
 */



int main()
{
	int a[100000], n, k, c = 0, i, temp;              // ??????100000?????
	cin >> n;                                         // ??n

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

	cin >> k;                                         // ???????

	for (; c < n; ++c)
	{
		if (a[c] == k)                                // ?????????????????????????n?1
		{
			for (i = c; i < n - 1; ++i)
			{
				temp = a[i];
				a[i] = a[i + 1];
				a[i + 1] = temp;
			}
			--n;
			c = -1;
 		}
	}

	cout << a[0];                                     // ??????

	for (c = 1; c < n; ++c)                           // ???????...??
		cout << " " << a[c];

	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)
		{
		    for(c=a;c<n;c++)
			{
				z[c]=z[c+1];
			}
			d=d+1;
			a-=1;
		}
	}
	for(a=1;a<=n-d;a++)
	{
		if (a<n-d)
		printf("%d ",z[a]);
		else
        printf("%d",z[a]);
	}
	return 0;
}
int main()
{
	double a[100000];
	int n,m,o=0,l;
	cin>>n;
	for(int i=0;i<n;i++)
		cin>>a[i];
	double k;
	cin>>k;
	for(int i=0;i<n-o;i++)
	{
		if(a[i]==k)
		{
			m=i;
			for(int j=m;j<n-o-1;j++)
			{
				a[j]=a[j+1];
			}
            o++;
			i--;
		}
	}
		for(l=0;l<n-o-1;l++)
			cout<<a[l]<<" ";
		cout<<a[l];
				return 0;

}
int swap(int *p1,int *p2)
{
    int x;
    x=*p1;
    *p1=*p2;
    *p2=x;
}

int main()
{
    int a[100000];
    int *p,*q,n,i,k,num=0;
    scanf("%d",&n);
    for (i=0;i<n;i++)
        scanf("%d",&a[i]);
    scanf("%d",&k);
    for (p=a;p<a+n;p++)
    {
        if (*p==k)
        {
            for (q=p+1;q<a+n;q++)
                if (*q!=k)
                {
                    swap(p,q);
                    num++;
                    break;
                }
        }
        if (*p==k)
            break;
    }
    for (q=a;q<p-1;q++)
        printf("%d ",*q);
    printf("%d",*q);
}
//*************************
//*???????????*
//*??????   * 
//*???11/10/28* 
//*******************
int main()
{
	int n, k, m = 0; 
	cin >> n; 
	if(n < 1 || n > 100000) return 0;
	int a[n]; 
	for(int y = 0; y < n; y ++) 
		cin >> a[y];
	cin >> k; 
	for (int i = 0; i < n; i ++)
	{
		if (a[i] == k)
		{
			for (int j = i; j < n; j ++)
			{
				a[j] = a[j + 1]; 
			}
			i --; m ++; 
		}
	}
	cout << a[0]; 
	for (int x = 1; x < n - m; x ++)
	cout << " " << a[x]; 
	cout << endl; 
	return 0; 
}
int main()
{
	int n,i,k,a[100001],b[100001],temp=0; //temp??????b[100001]?????? 
	cin>>n;
	for (i=0;i<n;i++)
	{
		cin>>a[i];	
	}
	cin>>k;
	for (i=0;i<n;i++)
	{
		if (a[i]!=k)
		{
			b[temp]=a[i];         //a[i]???k????? 
			temp++;	
		}	
	}
	for(i=0;i<temp-1;i++)
	{
		cout<<b[i]<<" ";	
	}
	cout<<b[temp-1];
	return 0;	
}
int main()
{
    int n,s[100000],m,i,tmp=0;
    scanf("%d",&n);
    for(i=0;i<n;i++)
    {
        scanf("%d",&s[i]);
}
    scanf("%d",&m);
	for(i=0;i<n;i++)
    {
       if((s[i]!=m)&&(tmp==0)) 
	   {
		   printf("%d",s[i]);
		   tmp=1;
	   }
	   else if((s[i]!=m)&&(tmp==1))
	   {
		   printf(" %d",s[i]);
	   }
	   
    }
   return 0;
}
int main()
{
int n,k,m;
scanf("%d",&n);
int a[n];
m=n;
for (int i=0;i<n;i++)
scanf("%d",&a[i]);
scanf("%d",&k);
for (int i=0;i<n;i++)
if (a[i]==k) {for (int j=i;j<n-1;j++) a[j]=a[j+1];i--;n--;}
for (int i=0;i<n-1;i++)
printf("%d ",a[i]);
printf("%d",a[n-1]);
}
int main()
{
int n,i,l,k,j;
l=0;
scanf("%d\n",&n);
long int a[100001];
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;j<n;j++)
a[j]=a[j+1];
l+=1;
i--;}
}
n-=l+1;
for(i=0;i<n;i++)
printf("%d ",a[i]);//????????????
                  printf("%d",a[n]);//????????
}
void main()
{
	int n,a[100000],*p,i,k,*temp;
	scanf("%d",&n);
	for(i=0;i<n;i++)
		scanf("%d",&a[i]);
	scanf("%d",&k);
	for(p=a;p<a+n;p++)
		if(*p==k)
		{
			temp=p;
			for(;p<a+n;p++)
				*p=*(p+1);
			n--;
			p=temp-1;
		}
		for(p=a;p<a+n-1;p++)
			printf("%d ",*p);
		printf("%d",*p);
}
int main()
{
	int n,i,j,k,count,sign,x;
	int a[100001];
	cin >> n;
	for(i = 1; i <= n; i++)
	{
		cin >> a[i];
	}
	cin >> x;
	count = 0;
	for(j = 1,k = 0; j <= n; j++)
	{	
		if(a[j] != x)
		{	
			k++;
		    a[k] = a[j];
		}
		else
			count++;
	}
	sign = 0;
	for(j = 1; j <= n - count; j++)
	{	
		if(a[j] != x)
		{	
			if(sign == 0)
			{	
				cout << a[j];
				sign++;
			}
			else
				cout << " " <<a[j];
		}
	}
	return 0;
}