semeru/Code-Code-CloneDetection-POJ104 huggingface dataset:
int main()
{
	int n,i,j,k,m,b,c,d,e,f,x;
	cin >> n;             
	int a[1000000];
	for(i = 1;i <= n;i++)
	{
		cin >> a[i];
	}
	cin >> x;      
	k = 0;
	for(j = 1;j <= n,k < 1;j++)
	{
		if(a[j] != x)
		{
			cout<< a[j];
			k++;
		}
	}
	for(m = j;m <= n;m++)
		if(a[m] != x)
			cout << " " <<a[m];
	return 0;
}
int main()
{
	int a[100000],n,k,m,i,j;
	cin >>n;
	for(i=0;i<n;i++)
	{
		cin >>a[i];
	}
	cin >>k;
	m=0;
	i=0;
	j=0;
	while(j<n)
	{
		
		if(a[j]!=k)
		{
			a[i]=a[j];
			i=i+1;
		}
		j=j+1;
	}


	for(j=0;j<i;j++)
	{
		if(j==0)
			cout<<a[j];
		else
			cout<<' '<<a[j];
	}
	return 0;
}
/**
 *  ????1027.cpp
 *  ?????????
 *  ??????
 *  ???2010.10.27
 */


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

	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)
		{
			
			a[j]=a[i];
			j++;
		}
	}
	cout << a[0];
	for (i=1;i<=j-1;i++)
	{
		cout << " " << a[i];
	}
	return 0;
}
int main()
{
    int n,k,i,j,count=0;
    cin >>n;
    int input[n+1];
    input[n]=0;
    for (i=0;i<n;i++)
       cin >>input[i];
    cin >>k;    
    for (i=0;i<n-count;i++)
      {
         if (input[i]==k)
          {
            for (j=i;j<n-count;j++)
               input[j]=input[j+1];
            count++;
            i=i-1;
          }
      }
    for (i=0;i<n-count-1;i++)
       cout <<input[i] <<" ";
    cout <<input[n-count-1];    

    return 0;
}
int main()
{
	int i,n,j,t[100000],a,k;
	scanf("%d",&n);
	for(i=0;i<n;i++){
		scanf("%d",&t[i]);
	}
	scanf("%d",&k);
	for(i=0;i<n;i++){
		if(t[i]!=k){
			a=i;
			printf("%d",t[i]);
			break;
		}
	}
	for(i=a+1;i<n;i++){
		if(t[i]!=k){
			printf(" %d",t[i]);
		}
		
	}
	
	return 0;
}
int main()
{
	int a[100000];
	int n,k,i,j,l;                    //???????????
	l=0;                              //???????????????
	cin>>n;                           //??????????
	for(i=0;i<n;i++)                  //????
		cin>>a[i];
	cin>>k;                         //???????
	i=0;
	while (i<n)
		{
		   if (a[i]==k)                  //??????????
		      {
			    for(j=i+1;j<=n-l;j++)        //???????????
				   {a[j-1]=a[j];}
                a[n-l-1]=0;
			    l=l+1;
                i=i-1;
		      }
		   i=i+1;
		}
	for(i=0;i<n-l-1;i++)                //??
		{cout<<a[i]<<" ";}
	cout<<a[n-l-1];
	return 0;}
/*
 * Filename:homework_deleteitems.cpp
 * Author:guan hon wei
 *  Created on: 2011-10-23
 * Function: Just for homework.......
 */



int main ()
{
	int n,i,k,c; //define the variables
	cin>>n; //read the total number of the array
	long int a[n]; // define the array as a long int (as I can't figure out what a signed integer should be defined)
	for (i=0;i<n;i++) // start loop of reading the array
	{
		cin>>a[i];
	}
	cin>>k; //process of reading is over
	for (i=n,c=0;i>0;i--) // checking from the back
	{
		if (a[i-1]==k) // when we find the target item k
		{
			for(i=i-1;i<n;i++) //we delete it
			{
				a[i] = a[i+1]; //and move the array behinds it
			}
			a[i]=0; //the last items equals 0
			c++;
		}
	}
	n=n-c; //the number of effective items
	for (i=0;i<n-1;i++)
	{
		cout<<a[i]<<' ';//print the array
	}
	cout<<a[i]; // incase there is an extra blank
	return 0;

}
main()
{
   int i,j,n,k;
   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)
     {
       for(j=i;j<n-1;j++)
       {
         a[j]=a[j+1];
         }
       n--;
       i--;
       }
     }
     for(i=0;i<n-1;i++)
       printf("%d ",a[i]);
       printf("%d\n",a[n-1]);
   getchar();
   getchar();
   getchar();
   return 0;
}
//
//  File.cpp
//  shuzu
//
//  Created by blues cookie on 12-10-28.
//  Copyright (c) 2012? blues cookie. All rights reserved.
//

int main(){
    int n,i,ex,num;
    int k;
    cin>>n;
    num=n;
    int a[n];
    for(i=1;i<=n;i++)
    {
        cin>>a[i];
    }
    cin>>ex;
    for(i=1;i<=n;i++)//??????n???
    {
        if(a[i]==ex)
        {
            for(k=i;k<n;k++)//?????????????????????
            {
                a[k]=a[k+1];
            }
            n=n-1;
            i=i-1;
        }
    }
   cout<<a[1];
    for(i=2;i<=n;i++)
    {
        cout<<" "<<a[i];
    }
    return 0;
}
/*
 *????????????
 *?????
 *??: 2010-11-4
 */

int main(){
	int a[100000];//????????
	int i,j,n,k,p,q;
	cin>>n;//??????
	for(i=0;i<n;i++)//?????????
	  cin>>a[i];
	cin>>k;//?????????
	for(i=0,p=0;p<n-1;p++){//???n-1???
		if(a[i]==k)//?????k
			for(j=i;j<n-1;j++)//?????
				a[j]=a[j+1];
		else i++;//??????k???+1
		}
	  if(i==0){
		  if(a[i]!=k) cout<<a[i];//????????
	      }
	  if(i==1){
		  cout<<a[0];
	      if(a[i]!=k) cout<<" "<<a[i];//????????
	      }
	  if(i>1){
	      cout<<a[0];
	      for(q=1;q<i;q++) cout<<" "<<a[q];
	      //??????n-1??????k??
	      if(a[i]!=k) cout<<" "<<a[i];
	      }//????????
	return 0;
}
/*
 * ????1.cpp
 * ??????
 * ????:2012-10-26
 * ???????????
 */

int main(){
	int n=0,A[100000],k=0,j=0;                 //????n,k,j???A
	cin>>n;                                    //??????????n
	for(int i=0;i<n;i++){cin>>A[i];}           //??????n???
	cin>>k;                                    //?????????k
	for(int i=0;i<n;i++)                       //????????????
	{
		A[i-j]=A[i];                       //????????????????
		if(A[i]==k){j++;}                  //?????????j
	}
	for(int i=0;i<n-j-1;i++){cout<<A[i]<<" ";} //???????????????????
	cout<<A[n-j-1];
	return 0;                                  //?????
}
/*
 *????1000010416_25.cpp
 *???????????
 *Created on: 2010-11-5
 *Author: ???
 */

int main(){//???
	int n,m;//????
	cin>>n;//??
	int a[200000];//????
	for(int i=0;i<=n-1;i++){//??
		cin>>a[i];
	}
	cin>>m;//??
	int i;
	for(i=0;i<=n-1;i++){//?????
			if(a[i]!=m){
				cout<<a[i];//??
				break;
			}
	}
	for(i++;i<=n-1;i++){//??  ??
		if(a[i]!=m){
			cout<<" ";
			cout<<a[i];//??
		}
	}
   return 0;
}
/*
 * ????1000012718_25.cpp
 * ???????????
 * ????: 2010-10-29
 * ??: ??
 */

/*#include<iostream>    //?????
 using namespace std;
 //?????

 int main() {
 //??n??
 int n, k, i, j, count = 0; //i, j, count?????
 cin >> n;
 if (n < 1 || n > 100000)
 return 0;

 //???????????
 int num[n];

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

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

 //????????k??
 for (i = 0; i < n; i++) {
 while (num[i] == k) {

 //??????????
 for (j = i; j < n; j++) {
 num[j] = num[j + 1];
 }

 count++; //count????k?????
 }
 }

 //??????????
 for (i = 0; i < n - count - 1; i++) {
 cout << num[i] << " ";
 }
 cout << num[i];

 return 0; //????
 }*/

int main() {
	int n, m, k, i = 0, j, temp, a[100000];
	cin >> n;
	for (i = 0; i < n; i++) {
		cin >> m;
		a[i] = m;
	}
	cin >> k;
	for (i = 0; i < n; i++) {
		if (a[i] == k) {
			for (j = i + 1; j < n; j++) {
				if (a[j] != k) {
					temp = a[j];
					a[j] = a[i];
					a[i] = temp;

					break;
				}
			}
		}
	}
	if (a[0]!=k) cout << a[0];
	for (i = 1; i < n; i++) {
		if (a[i] != k)
			cout << ' ' << a[i];

	}
	return 0;
}
/*
 * shanchushuzu.cpp
 *
 *  Created on: 2012-10-31
 *      Author: ??
 *      ????????
 */



int main() {
	int a[100010], i = 0, n = 0, k = 0, j = 0, b = 0; //????
	cin >> n; //????

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

	cin >> k; //????
	for (i = 1; i <= n; i++) { //????
		if (a[i] == k) 
                   {
			b++;
			if (i != (n - b + 1)) { //?a[i]???????
				for (j = i; j <= (n - b); j++)
					a[j] = a[j + 1];
				i--; //????
			} else
				break; //????
		}
	}
	cout << a[1];
	for (i = 2; i <= (n - b); i++)
		cout << " " << a[i]; //????a[1]???

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


int main(void)
{
	int n, a[100000]; // n?????????????a?
	int k; // k????????
	cin >> n;
	for(int i = 0; i < n; i++)
		cin >> a[i]; // ????
	cin >> k;
	for(int j = 0; j < n; )
	{
		if(a[j] == k) // ?????k?????
		{
			n--; // ??????????????
			for(int x = j; x < n; x++)
				a[x] = a[x + 1]; // ???????
		}
		else j++; // ?????k???????????????
	}
	for(int y = 0; y < n - 1; y++)
	{
		cout << a[y] << ' '; // ????
	}
	cout << a[n - 1] << endl;
	return 0;
}
/*
 * c.cpp
 * ???1100012870;
 * ???????
 *  Created on: 2011-10-19
 *      Author: Li Wenpeng
 */
int main()
{
	int i,j;
	long int a[100001],n,k,m;
	memset(a,0,sizeof(a));
	cin>>n;
	m=n;
	for(i=0;i<n;i++)
	{
		cin>>a[i];
	}
	cin>>k;
	for (i=0;i<m;i++)
	{
		while (a[i]-k==0)
		{
			if (m-i==1)
			{
				m=m-1;
				break;
			}
			for (j=i;j<m-1;j++) a[j]=a[j+1];
			m=m-1;
		}
	}
	cout<<a[0];
	for (i=1;i<m;i++) cout<<' '<<a[i];
	return 0;
}
main()
{
  int n,k,i,j,a[100000],*p;
  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+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++);
  p=a;
  printf("%d",*(p+i-1));
}
/*
 * wwj.cpp
 *  Created on: 2012-11-4
 *      Author: ???  1200012899
 */
int main ()
{
	int n,a[100001],k;
	int i,l,j,s=0,m;
	cin>>n;
	for(i=0;i<n;i++)
	{
		cin>>a[i];
	}
	cin>>k;
	for(i=0;i<n;i++)
		{
			if(a[i]==k)
				s=s+1;
		}
   for(i=0;i<n;i++)
	{
	    l=0;
	    m=i;
		while(a[m]==k)
		{
			l=l+1;
			m=m+1;
		}
		if(l!=0)
		{
			for(j=i;j+l<n;j++)
			{
				a[j]=a[j+l];
			}
		}
		else continue;
	}
		for(i=0;i<n-s;i++)
		{
			if(i!=0)
				cout<<" ";
			cout<<a[i];
		}

	return 0;
}
/**
 * @file   2.cpp
 * @author ???
 * @date   2013-10-30
 * @description
 *         ?????????(11-4) ????????
 */



int main()
{
	int a[100000] = {0}, n, k, c = 0;
	cin >> n;

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

	cin >> k;

	for (; c < n; ++c)
	{
		if (a[c] != k)
		{
			cout << a[c];
			++c;
			break;
		}
	}

	for (; c < n; ++c)
	{
		if (a[c] != k) cout << " " << a[c];
	}

	return 0;
}
//============================================================================
// Name        : 1.cpp
// Author      : 
// Version     :
// Copyright   : Your copyright notice
// Description : Hello World in C++, Ansi-style
//============================================================================


int main() {
	int n;
	cin>>n;
	int n1=n;                       //n1???????????
	int a[n];
	for(int i=1;i<=n;i++)
		cin>>a[i];
	int b;
	cin>>b;
	int t=1;                        //t????????????????????????????????????
	for(int i=1;t<=n;i++)
	{
		if(a[t]==b)                 //???????
		{
			n1=n1-1;
			for(int j=t;j<=n;j=j+1)
				a[j]=a[j+1];
			t=t-1;                  //???????????????????????
		}
		t=t+1;
	}
	cout<<a[1];                     //?????????
	for(int i=2;i<=n1;i++)
		cout<<" "<<a[i];
	return 0;
}
int main()
{
	int num[100000];
	int n, i, del;
	cin >> n;
	for (i = 1; i <= n; i++)
	{
		cin >> num[i - 1];
	}
	cin >> del;
	int wNo, sNo, count = 0;
	for (wNo = 0; wNo < n - count; wNo++)
	{
		if (del == num[wNo])
		{
			for (sNo = wNo; sNo < n - count; sNo++)
			{
				num[sNo] = num[sNo + 1];
			}
			count += 1;
			wNo = -1;
		}
	}
	int oNo;
	for (oNo = 1; oNo < n - count; oNo++)
	{
		cout << num[oNo - 1] << " ";
	}
	cout << num[oNo - 1] << endl;
	return 0;
}
int main()
{
 int d=0,n,a[100000],i,b;
 scanf("%d",&n);
 for (i=0;i<n;i++)
 scanf("%d",&a[i]);
 scanf("%d",&b);
 for (i=0;i<n;i++)
 {
  
  if ( a[i]!=b&&d==0 )
  {
  printf("%d",a[i]);
  a[i]=b;
  d=1;
  }
  if ( a[i]!=b )
  printf(" %d",a[i]);
 }
 
}
int main()
{
int sz[100000],n,i,k,max;

scanf("%d",&n);

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

scanf("%d",&k);

if(n==1){
	max=0;}
else{

for(i=0;i<(n-1);i++){

	if(sz[i]!=k&&sz[i+1]==k){
		max=i;}
	else if(sz[i+1]!=k){
		max=i+1;}
}
}

for(i=0;i<n;i++)
{
	if(sz[i]!=k&&i!=max)
	{
		printf("%d ",sz[i]);
	}
	else if(sz[i]!=k&&i==max)
	{
		printf("%d",sz[i]);
	}
}

return 0;

}
/*
 * 1000012786_25.cpp
 *
 *  Created on: 2010-10-29
 *      Author: ??
 */
int main(){
	int n,b=0;//??????????n
	cin>>n;//????????
	const int i=n;//?????i???n????i
	int a[i];//????a[i]
	for(b=0;b<i;b++)
		cin>>a[b];//???????
	int d,h=0,c;//????????
	cin>>d;//????????
	for(b=i-1;b>=0;b--)
		if(a[b]==d){
			for(c=b;c<=i-1;c++) a[c]=a[c+1];
			h++;
		}//???????????????
         int f=i-h;
	for(b=0;b<f - 1;b++) {cout<<a[b]<<" ";}//????????
         cout << a[ f - 1 ];
	return 0;
}
void main()
{  
   long m,j,i,n,*p,*q,*head;
   scanf("%ld",&n);
   p=(long*)malloc(100000*sizeof(long int));
   for(i=0;i<n;i++,p++)
   {
       scanf("%ld",p);
   }
   int k;
   scanf("%ld",&k);
   p=p-n;
   j=0;
   for(i=0;i<n;i++,p++)
   {
   	if(*p!=k&&j!=1)
   	    {
		 j=1;
   		 printf("%ld",*p);
   	     }
          
    else if(*p!=k)
         {
                   printf(" %ld",*p);
          }   
   }
   }
main()
{
  int n,a[100001],k,i,j,num=0;
  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)
     {
      num++;
      for(j=i;j<n;j++)
      a[j]=a[j+1];
     }
     if(a[i]==k)
     i--;
  }
  printf("%d",a[0]);
  for(i=1;i<(n-num);i++)
   printf(" %d",a[i]);
}
//**************************** 
//*???????????    *
//*????? 1200012708     *
//*???2012?10?29?      *
//**************************** 

int main()
{
    int a[100005], n, k, i; // n??????k?????? 
    cin >> n;
    for (i = 0; i < n; i++)
    {
        cin >> a[i];
    }
    cin >> k;
    i = 0; // ??????? 
    while (i < n) // i??n???????????? 
    {
        // ??????????????????????????????????-1 
        if (a[i] == k) 
        {
            for (int j = i; j < n - 1; j++)
            {
                a[j] = a[j + 1];
            }
            n--;
        }
        else // ??i?????????????????? 
        {
            i++;
        }
    }
    cout << a[0];
    for (i = 1; i < n; i++)
    {
        cout << " " << a[i];
    }

    return 0;
}
int main()
{
	int n,k,s;
	int i,a;
	scanf("%d",&n);
	s=0;
	int*sz=(int*)malloc(sizeof(int)*n);
	for(i=0;i<n;i++)
	{
		scanf("%d",&sz[i]);
	}
	scanf("%d",&k);
	for(i=0;i<n;i++)
	{
		while(sz[i]==k)
		{
			for(a=i;a<n;a++)
			{
				sz[a]=sz[a+1];
			}
			s++;
		}
	}
	for(i=0;i<n-s;i++)
	{
		if(i==0)
		printf("%d",sz[i]);
		else if(i!=0)
			printf(" %d",sz[i]);
	}
	free(sz);
return 0;
}
void main()
{
	int a[100000],*p,n,i,k,*p1,num=0,t;
	scanf("%d\n",&n);
	for(p=a;p<a+n;p++)
	   scanf("%d",p);
    scanf("\n");
    scanf("%d",&k);
    for(p=a;p<a+n;p++)
       if(*p==k)
       {
       	p1=p;t=0;
       	while(*p1==k)
       	{p1++;num++;t++;}
       	for(i=0;p+i<a+n;i++)
       	*(p+i)=*(p1+i);
       }
    n-=num;
    for(p=a;p<a+n-1;p++)
       printf("%d ",*p);
    printf("%d\n",*p);
}
void main()
{
	int n,k,a[100001],i;
	int time=0,first=1;
	void ahead(int *head,int *tail);
	void exchange(int *p,int *q);

	scanf("%d",&n);
	for(i=1;i<=n;i++)
		scanf("%d",a+i);
	scanf("%d",&k);

	for(i=1;i<n;i++){
		while(*(a+i)==k&&time<=n-i){
			ahead(a+i,a+n);
			time++;
		}
		time=0;
	}
	
	for(i=1;i<=n;i++){
		if(*(a+i)==k) break;
		if(first==1){
			printf("%d",*(a+i));
			first=0;
		}
		else printf(" %d",*(a+i));
	}

	printf("\n");
}

void exchange(int *p,int *q)
{
	int temp;
	temp=*p;
	*p=*q;
	*q=temp;
}

void ahead(int *head,int *tail)
{
	if(head==tail-1) exchange(head,tail);
	else{
		exchange(head,head+1);
		head++;
		ahead(head,tail);
	}
}
struct number
{
	int num;
	struct number *next;
};
int n,k;
struct number *creat()
{
	struct number *head;
	struct number *p1,*p2;
	int num=1;
	head=NULL;
	while (num<=n)
	{
		p1=(struct number *)malloc(LEN);
		scanf("%d",&p1->num);
		if (num==1)
			head=p1;
		else
			p2->next=p1;
		p2=p1;
		num++;
	}
	p2->next=NULL;
	return (head);
}
void delet (struct number *pt)             //??????????????????????
{
	struct number *p,*pre;
	int sum=0,i;
	for (p=pt;p;p=p->next)
	{
		if (p->num==k)
			sum++;
	}
	for (i=1;i<=sum;i++)
	{
		for (p=pre=pt;p;p=p->next)
		{
			if (p->num!=k)
				pre=p;
			else
				break;
		}
		if (p==pt)
			pt=p->next;
		else
			pre->next=p->next;
		free(p);
	}
	for (p=pt;p->next!=NULL;p=p->next)
		printf("%d ",p->num);
	printf("%d",p->num);
}

int main()
{
	struct number *pt;
	scanf("%d",&n);
	pt=creat();
	scanf("%d",&k);
	delet(pt);
	return 0;
}
/*
 * ???2010?11?1?
 * ?????
 * ???????????
 *
 */
int main() {
	int n,  k, i = 0, j, temp, a[100000];
	cin >> n;//??????
	for (i = 0; i < n; i++) {
		cin >>  a[i];//?????
	}
	cin >> k;//??????k?
	for (i = 0; i < n; i++) {
		if (a[i] == k) {
			for (j = i + 1; j < n; j++) {
				if (a[j] != k) {
					temp = a[j];
					a[j] = a[i];
					a[i] = temp;

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

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

    cout << endl ;
	return 0 ;
}
int main()
{
	int n, i, r, s, u, m, a, t = 0;
	cin >> n;
	int num[100000] = {0};
	for (i = 0; i <= n - 1; i++)
	{
		cin >> num[i];
	}
	cin >> a;
	for (r = 0; r <= n - 1; r++)
	{
		if (num[r] == a)
		{
			t = t + 1;
		}
		if (num[r] != a)
		{
			num[r - t] = num[r];
		}
	}
	cout << num[0];
	for (m = 1; m <= n - 1 - t; m++)
	{
		cout << " " << num[m];
	}
	cout << endl;
	return 0;
}
//********************************
//*????2.cpp   **
//*?????? 1300012966 **
//*???2013.10.30  **
//*??????????   **
//********************************
int main()
{
	int n, a[100001], k, i, j;
	cin >> n;
	for (i = 1; i <= n; i++)
	{
		cin >> a[i];
	}
	cin >> k;
	j = 0;
	for (i = 1; i <= n; i++)
	{
		if (a[i] == k)
		{
		}
		else
		{
			if (j == 1)
			{
				cout << " " << a[i] ;
			}
			else
			{
				cout << a[i];
			}
			j = 1;
		}
	}
	return 0;
}
int main()
{
    
    int i,k,n,p,j;
	int a[100010];
	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 n,k,l;
	cin>>n;
	int a[n];
	for(int i=0;i<n;i++) cin>>a[i];
	cin>>k;
	l=n;
	for(int i=0;i<l;){
		if(a[i]==k){
			for(int j=i;j<l-1;j++) a[j]=a[j+1];
			l--;
		}
		else i++;
	}
	for(int i=0;i<l;i++){
		cout<<a[i];
		if(i!=l-1) cout<<' ';
	}
	return 0;
}
int main(){
    int n,sz[100000],k,i,j,num;
    num=0;
    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(j=i;j<n-1;j++){
                                                   sz[j]=sz[j+1];
                                                   }
                                  num++;
                                  i--;
                                  n--;
                     
                                  }
                     }
    for(i=0;i<n-1;i++) printf("%d ",sz[i]);
    printf("%d",sz[n-1]);


    return 0;
}
//**********************************
//*????????.cpp            *
//*??????                    *
//*???2011-10-19                *
//**********************************


int main()
{
	int a[100000] = {0};         //?????????
	int n;                       //??n???????????????? 
	int count = 0;               //??count??????????????
	int i, j;                    //??i, j?????
	int num;                     //??num??????
	cin >>n;
	//??n??? 
	for (i = 0; i < n; i++)
	{
		cin >> a[i];
	}
	//?????? 
	cin >> num;
	//????????I????????????count?1?????????????????I+1????????I???????????????????I=I-1 
	//??????????????????n - count?????? 
	for (i = 0; i < n - count; i++)
	{
		//???????????????????????????????count?1?????????1?? 
		if (num == a[i])
		{ 
			for (j = i; j < n - 1; j++)
				{
					a[j] = a[j + 1];
				}
				count++;
				i = i - 1;
					}
	}
	//????????????n - count?????? 
	for (i = 0; i != n - count; i++)
	{
		cout << a[i];
		//?????????????????????????? 
		if(i != n - count - 1)
			cout << " ";
	}
	return 0;
}
int main()
{
	int n,i,j,x,shu=0;
	cin>>n;
	int a[n];
	for(i=0;i<n;i++)
		cin>>a[i];
	cin>>x;
	for(i=0;i<n;i++)
	{
		if(a[i]!=x)
		{
			if(shu==0)
				cout<<a[i];
			else
				cout<<" "<<a[i];
			shu++;
		}
	}
	return 0;
}
void main()
{
	int n,m,i,j=0,k,*a,*b;
	a=(int *)malloc(100000*sizeof(int));
	scanf("%d",&n);
	b=a;
	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));
	}
	
}
void main()
{
int n,i,j,m=0,t=0,q=0;
long int a[100000];
long int k;
scanf("%d\n",&n);
for(i=0;i<n;i++)
scanf("%ld",&a[i]);
scanf("%ld",&k);

for(i=0;i<n;i++)
{if (a[i]!=k) {printf("%ld",a[i]);q=i;break;}}


for(j=q+1;j<n;j++)
	{
	if (a[j]==k) 
	{for(t=j;t<n-1;t++)
		{a[t]=a[t+1];
		}
	a[n-1]=' ';
	j=j-1;}
	}

for(i=q+1;i<n;i++)
if (a[i]!=' ') printf(" %ld",a[i]);
else break;
}
//********************************
//*???????????       **
//*?????? 1300012773      **
//*???2013.10.30             **
//********************************
int main()
{
    int a[100000]; //???????·???100000???
    int n, k; //??i?j??????n??????????k????????
    cin >> n; //???????n

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

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

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

	}

	cout << a[0];
	for(int i = 1; i < n; i++)
	{
		cout << ' ' << a[i];
	}

	return 0;
}
int main(){
	int n,i,k=0,p;
	scanf("%d",&n);
	int a[1000000],b[1000000];
	for(i=0;i<n;i++){
		scanf("%d",&a[i]);
	}
	'\n';
	scanf("%d",&p);
	for(i=0;i<n;i++){
		if(a[i]!=p){
			b[k]=a[i];
			k++;
		}
	}
	for(i=0;i<k-1;i++){
		printf("%d ",b[i]);
	}
	printf("%d",b[k-1]);
	return 0;
}
struct num
{
	int n;
	struct num * next;
};
int a;

struct num *creat()
{
	struct num *head;
	struct num *p1,*p2;
	int i;
	p1=p2=(struct num*)malloc(LEN);
	scanf("%d",&p1->n);
	head=p1;
	for(i=1;i<a;i++)
	{
		p2=p1;
		p1=(struct num*)malloc(LEN);
		p2->next=p1;
		scanf("%d",&p1->n);
	}
	p2=p1;
	p2->next=null;
	return head;
}

struct num *del(struct num *head,int a,int m)
{
	struct num *p1,*p2;int i;
	if(head==null) return head;
	p1=head;
	for(i=0;i<a;i++)
	{
		if(m!=p1->n&&p1->next!=null)
		{
			p2=p1;p1=p1->next;
		}
		else if(m==p1->n)
		{
			//printf("%d",p1->n);
			if(p1==head) head=p1->next;
			else p2->next=p1->next;
			p1=p1->next;
		}
	}
	return head;
}

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

void main()
{
	struct num *creat();
	struct num *del(struct num *head,int a,int m);
	void print(struct num *head);
	struct num *head;int m;
	scanf("%d",&a);
	head=creat();	//print(head);
	scanf("%d",&m);
	head=del(head,a,m);
	print(head);
}
int main()
{
	int flag=0,n,i,num,j,a[100000];
	cin>>n;//??????
	for(i=0;i<=n-1;i++)
		cin>>a[i];//?????
	cin>>num;//???????
	for(i=0;i<=n-1;i++)
		if(a[i]==num)
		{
			for(j=i;j<=n-2;j++)
				a[j]=a[j+1];//??????????????????????????
			i=i-1;//?i-1,??????
			n=n-1;//?n????????
		}
	for(i=0;i<=n-1;i++)
	{
		 if(flag==0)
		{
		  cout<<a[i];
		  flag=1;
		  continue;//????????flag??????????????
		}

		 cout<<" "<<a[i];//??????
	}
	return 0;
}