semeru/Code-Code-CloneDetection-POJ104 huggingface dataset:
void main()
{
	int n,i,k,m,a[100000];
	scanf("%d\n",&n);
	for(i=0;i<n-1;i++)
		scanf("%d ",&a[i]);
	scanf("%d",&a[n-1]);
	putchar('\n');
	scanf("%d",&k);
	for(i=0;i<n;i++)
	{
		if(a[i]==k)
		{
			for(m=i;m<n;m++)
				a[m]=a[m+1];
			i--;
             n=n-1;
		}
	}
	printf("%d",a[0]);
	for(i=1;i<n;i++)
	printf(" %d",a[i]);
}
int main()
{
	int c,a[100000],b,i,j,k,f=0;
	scanf("%d",&c); 

	for (j=0;j<=c-1;j++)
	{scanf("%d",&a[j]);}

    scanf("%d",&b);
	for (j=0;j<=c-1;j++)
	{if (a[j]==b) 
	{for (k=j+1;k<c;k++)
	{if(a[k]!=b) {a[j]=a[k];a[k]=b;break;}
	}}
        if (a[j]==b) break; 
	}

	for (i=0;i<j;i++)
	{if (i==j-1)
	printf("%d",a[i]);
	else 	printf("%d ",a[i]);}
   	
}
int main()
{  int n,i,*p,j,m,z;
   int k,a[100000];
   scanf("%d",&n);
   for (i=0;i<=(n-1);i++)
       scanf("%d",&a[i]);
   scanf("%d\n",&k);
   z=0;
   for (i=0;i<=(n-1);i++)
      {if ((a[i])==k) {z++;
                       for (j=(i+1);j<=(n-1);j++)  
                          {if (a[j]!=k) {m=a[i];a[i]=a[j];a[j]=m;z--;break;}
                             }
                         
       }}
  p=&a[0];
  printf("%d",*p);
  for (p=a+1;p<(a+n-z);p++)
     printf(" %d",*p);


 }
//????????
int a[100001];
int main()
{
	int n, i, j, k;
	cin >> n;  //????
	for (i = 1; i <= n; ++i) cin >> a[i];
	cin >> k;
	for (i = j = 1; i <= n; ++i)
	{
		if (a[i] == k)
		{
			for (j = max(j, i); j <= n; ++j)
				if (a[j] != k) break;
			if (j <= n) swap(a[i], a[j]);
			else break;
		}
		if (i > 1) cout << ' ';
		cout << a[i];
	}
	return 0;
}
/*
 * shanchuyuansu.cpp
 *
 *  Created on: 2013-10-30
 *      Author:???1300012996
 */
int main(){
	int n,m;
	cin>>n;
	int a[n];
	for (int i=0;i<n;i++){
		cin>>m;
		a[i]=m;}
	int k,j=1;
	cin>>k;
	for(int ii=0;ii<n;ii++){
		if(a[ii]!=k&&j==1)
			{cout<<a[ii];j+=1;}
		else if (a[ii]!=k&&j!=1)cout<<' '<<a[ii];
	}
	return 0;
}
/*
 * 1.cpp
 *
 *  Created on: 2012-10-29
 *      Author: AK
 */
int main()
{
	int n,i,k,j,s=0;//??????n?????i?j????k??????s
    cin>>n;
    const int p=n;//???????p??????????????
	int a[p];
	for(i=0;i<=(n-1);i++)
	{
		cin>>a[i];        //??????????????
	}
	cin>>k;
	for(i=n-2;i>=0;i--)  //????????????
	{
		if(a[i]==k)       //???????k
		{
			s=s+1;        //?s+1
			for(j=i;j<=n-2;j++)  //?????????
				a[j]=a[j+1];
		}
	}
	if(a[n-1]==k) s=s+1;  //?????????????k???s+1
	for(j=1;j<=n-s-1;j++)
	{
		cout<<a[j-1]<<' ';//????????-1????
	}
	cout<<a[n-s-1];//?????????
	return 0;
}
//*****************************************************
// ?? - ???????? 
// ??   1000012818
// 2010 10 30
//******************************************************
int main()
{
	int n, k, m, i, j, a[100001] = {0};      //???????
	cin >> n;
	m = n;
	for( i = 0; i <= n - 1; i ++ )
	{
		cin >> a[i];                         //????????
	}
	cin >> k;                                //???????
    i = 0;
	while( i <= n - 1 )
	{
		if( a[i] == k )                      //???????????????
		{
			for( j = i; j <= n - 1; j ++ )   
			{
				a[j] = a[j + 1];             //????????????????
			}
			m = m - 1;                       //???????
		    i --;                            //???????????????
		}
	    i ++;
	}
	for( i = 0; i <= m - 1; i ++ )
	{
		if( i == m - 1 )
		    cout << a[i] << endl;
		else 
			cout << a[i] << " ";            //????
	}
	return 0;
}
/*    ???????????
???????
???2010?10?29?
?????????????????
*/
int main()
{
	int a[100001]={0} , n , number , i , j , b = 0 , k ;    //n????number????b????????k??????
	cin >> n ;
	for (i = 0 ; i <= n - 1 ; i ++)    
	{ cin >> number ; a[i] = number ;}                      //?????????
	cin >> k ;
	for (i = 0 ; i <= n - 1 - b ; )                         //???????k?i
	{
		if (a[i] == k)  
		{
			i = i ;
			b++ ;
			for (j = i ; j <= n-1 ; j ++)                   //????k??????????i????i??i?????????k?i++?????
			a[j] = a[j+1] ;
		}
		else i++ ;
	}
		cout << a[0] ;
		for (i = 1 ; i <= n - b - 1; i ++)                  //???????
		cout << " " << a[i] ; 
	return 0 ;
}
void main()
{
int n,i,j,t=0;
long int k,a[100000]={0}, *point1,*point2;

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

point1=a;
for(i=0;(i<n)&(t<=n);i++,point1++)
{
	if (*point1==k) 
		{point2=point1;
			for(j=i;j<n-1;j++,point2++)
				{*point2=*(point2+1);}
		*point2=k;
		point1--;
		i--;
		t++;
		}
}

point1=a;
if (*point1!=k) printf("%ld",*point1);
point1++;

for(i=0;i<n-1;i++,point1++)
if (*point1!=k) printf(" %ld",*point1);
}
int main()
{
	int n,i,m,x=0;
	int a[100000];
	cin>>n;
	for(i=0;i<n;i++)
	{
		cin>>a[i];
	}
	cin>>m;
	for(i=0;i<n;i++)
	{
		if(a[i]!=m)
		{
			x++;
			if(x==1)
			{
				cout<<a[i];
			}
			else
			{
				cout<<" "<<a[i];
			}
		}
	}
	return 0;
}
int main()
{
	int a[100010]={0}, n, k , i, s, del=0, j;//??????
	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];
		        i=i-1;
			del++;//???????
			}
	}
			for (i=1;i<n-del;i++)//???
				cout << a[i] << ' ';
                cout << a[i];
}
int main(){
	int i,j,n,k,a[100000],t;  //???????i?j??????n?k??????t?????
	cin>>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++){
				if(a[j]!=k){t=a[i];a[i]=a[j];a[j]=t;break;}
		}   //?????????????????a[i]??break?
	}
	}
	cout<<a[0];   //???????????????
	for(i=1;i<n;i++){
		if(a[i]==k)break;  //??????k????????????
		cout<<" "<<a[i];
	}
return 0;
}//?????
/*
 *????HW5_01.cpp
 *??????1100019007?
 *???2012-10-28
 *??????????? 
 */ 
int arr[100000];//???
int main()
{
  int n,i;//??n,i
  int current_pos=0;//????
  int what_to_delect;//????? 
  cin>>n; 
  for(i=0;i<n;i++)cin>>arr[i];//???? 
  cin>>what_to_delect;
  for(i=0;i<n;i++)
  {
        if(arr[i]!=what_to_delect)//?????? 
        { 
            arr[current_pos]=arr[i];//??????????? 
            current_pos++;
        }
  }
  for(i=0;i<current_pos-1;i++){
        cout<<arr[i]<<" ";//???? 
    }
    cout<<arr[current_pos-1]<<endl;
  return 0;//????
}
//????????   ???  12858
int main()
{
	int a[100001];     //?????????
	int n = 0, i = 0, j = 0, k = 0;   //k???????n?????
	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-1; j++)
				a[j] = a[j+1];
			n = n-1;              //???-1
			i = i-1;              //??????????i?????????
        }
	for (i = 1; i <= n; i++)           //????
		if (i == n) 
			cout << a[i];
		else
			cout << a[i] << ' ';
    return 0;
}
main()
{
         int n,k;
         int i=0;
         int m=0;
         int s=0;
         int a[100000];
         scanf("%d",&n);
         for(i;i<n;i++)
         {
                  scanf("%d",&a[i]);
                  m++;
         }

         scanf("%d",&k);
         while (s!=m)
         {
                  if(a[s]==k)
                  {
                           m--;
                           i=s;
                           for(i;i<m;i++)
                           {a[i]=a[i+1];}
                  }
                  else s++;
         }
         printf("%d",a[0]);
         for(i=1;i<m;i++)
         printf(" %d",a[i]);

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

	for (i=0;i<n-m;i++)
	{
		if (a[i]!=k)
			continue;
		else if (a[i]==k)
		{
			for (j=i;j<n-m;j++)
			{
				a[j]=a[j+1];//???????????
			}
			m++;
			i--;//??i????????????????????????????????????????????????i--??????i?????
		}
	}
	for (i=0;i<(n-m);i++)
	{
		if (i<(n-m-1))
			cout<<a[i]<<" ";//???????
		else if (i==(n-m-1))
            cout<<a[i]<<endl;//???????
	}
	return 0;
}
int main()
{int n,a[100000],k,i,j;
 scanf("%d",&n);
  for(i=0;i<n;i++)
   scanf("%d",&a[i]);
  scanf("%d",&k);
   for(i=0;i<n;i++)
   if(a[i]==k) a[i]=65500;
    for(i=0;i<n;i++)
    if(a[i]!=65500)
   {printf("%d",a[i]);break;}
    for(j=i+1;j<n;j++)
    if(a[j]!=65500)
    printf(" %d",a[j]);
   return 0;
}
int main()
{
 int n=0,k=0,i=0,j=0,l=0,m=0;            //??????????
 cin>>n;                     //??n
 int a[100000];              //?????100001??????
 for(i=0;i<=n-1;i++)         //???????
  cin>>a[i];
 cin>>k;                     //??k
 while(j < n){               //????n??
  while(a[j] == k &&j<=n-1){  //????????k??????????????
   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;
}
/**
* @file homework.cpp
* @author ???
* @date 2011-10-19
* @description
* ??????: ????????
*/
int main()
{
	int n, i, j, k, num = 0;
	cin>>n;
	int a[100000];
	for (i = 0; i < n; i++)
		cin>>a[i]; // ?n??????
	cin>>k;
	for (i = 0; i < n; i++)
	{
		if (a[i] == k) num = num + 1; // ?a[i]??????num?1
		else a[i - num] = a[i];	// ??a[i]???num?
	}
	for (j = 0; j < n - num; j++)
		if (j != n - num - 1) 
			cout<<a[j]<<" ";
		else cout<<a[j]; // ????????????
	return 0;
}
//********************************
//*???2.cpp   **
//*?????? 1200012768 **
//*???2012.10.30 **
//*???????????  **
//********************************
int main()               
{
	int n, m, p, count = 0;
	cin >> n;
	int a[n];
	for (int i = 0; i < n; i++)
		cin >> a[i];
	cin >> p;
	for (int j = 0; j < n; )
	{
		if (a[j] == p)
		{
			for (int k = j; k < n - 1; k++)
				a[k] = a[k + 1];
			count++;
			n--;
		}
		else
			j++;
	}
	for (int i = 0; i < n; i++)
	{
		cout << a[i];
		if (i < n - 1)
			cout << " ";
		else
			cout << endl;
	}
	return 0;
}
//*************************
//??? 2.????????
//??  ??? 1200062705
//??    2012-11-3
//*************************
int main()
{
    int a[100001], n, i, j, k, number;
    cin >> n;
    for (i = 1; i <= n; i++)
    {
	    cin >> number;
	    a[i] = number;
    }
    cin >> k;
    for (j = 1; j <= n; j++)
    {
    	if (a[j] == k)
        {
    		for(; j <= n; j++)
    		{
    			a[j] = a[j+1];
    		}
            j = 0;
            n = n - 1;
        }
    }
    for (i = 1; i < n; i++)
    {
    	cout << a[i] << " ";
    }
    cout << a[n];
}
int main()
{
	int a[100000],n,i,k,*p,*q;
	scanf("%d",&n);
	for(p=a;p<a+n;p++)
	{
		scanf("%d",p);
	}
	scanf("%d",&k);
	p=a;
	for (p=a;p<a+n;p++)
	{
		if (*p==k)
		{
			for (q=p;q<a+n;q++)
			{
				*q=*(q+1);
			}
			p--;
			n--;
		}
	}
	for (q=a;q<a+n-1;q++)
	{
		printf("%d ",*q);
	}
	printf("%d",*(a+n-1));
	return 0;
}
int main()
{
	int n,a[100000],k;//???????????
	int i,p=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[p++]=a[i];

    for (i=0; i<p-1; i++)
        cout<<a[i]<<" ";
    if (p>0) cout<<a[p-1]<<endl;

	return 0;
}
int main()
{
    int i,j,k,n,l,sum;
    int a[100001];
    scanf("%d",&n);
    for(i=0;i<n;i++)
    {
                    scanf("%d",&a[i]);
    }
    scanf("%d",&k);
    sum=0;
    for(i=0;i<n;i++)
    {
                    if(a[i]==k)
                    {
                               sum++;
                    }
    }
    for(i=0;i<n;i++)
    {
                    for(j=1;j<=100;j++)
                    {
                                         if(a[i]==k)
                                         {
                                                    for(l=i;l<n-1;l++)
                                                    {
                                                                    a[l]=a[l+1];
                                                    }
                                         }
                    }
    }
    if(a[0]!=k)
    {
               printf("%d",a[0]);
    }
    for(i=1;i<n-sum;i++)
    {
                       printf(" %d",a[i]);
    }
    return 0;
}
int main()
{
	int a[100000],b,c,f=0;
	int n;
	cin>>n;
	for(int i=1;i<=n;i++)
	{
		cin>>b;
		a[i-1]=b;
	}
	cin>>c;
	for(int j=1;j<=n;j++)
	{
		if(a[j-1]-c!=0)
		{
			if(f==0)
			{
				cout<<a[j-1];
				f++;
			}
			else
			{
				cout<<" "<<a[j-1];
			}
		}
	}
	return 0;
}
int main()
{
	int a[100001] = {0};
	int i, j, n, k, count = 0;
	cin >> n;
	for (i = 0; i < n; i++)
		cin >> a[i];
	cin >> k;
	i = 0;
	do
	{
		if (a[i] == k)
		{
			count++;
			for (j = i; j < n; j++)
			{
				 if (a[j+1] != k)
					 a[j+1-count] = a[j+1];
				 else
					 count++;
			}
		}
		i++;
	}while (j < n);
	cout << a[0];
	for (i = 1; i < (n - count); i++)
		cout << " " << a[i];
	cout << endl;
	return 0;
}
int main()
{int num[100500]={0};
 int n,i,j,k,count=0;
 cin>>n;
 for(i=0;i<n;i++) cin>>num[i];
 cin>>k;
 
 for(i=0;i<n;i++)   //??k???????? 
  while(num[i]==k)
    {count++;
     for(j=i;j<n-1;j++) num[j]=num[j+1];
     num[n-1]=12365;} //???????? 
 for(i=0;i<n-count-1;i++) cout<<num[i]<<" "; //??????? 
 if(n-count-1>=0)cout<<num[n-count-1];
 cout<<endl; 

 return 0;
    }
int main(void)
{
    int n, i,j, a[m], b;
    scanf("%d", &n);
    for(i=0; i<n; i++)
        scanf("%d", &a[i]);

    scanf("%d", &b);

    for(i=0; i<n; i=i+1)
    {
        if (a[i]==b)
        {
            for(j=i; j<n-1; j=j+1)
                a[j]=a[j+1];
            n=n-1;
            i=i-1;
        }
    }
    for(i=0; i<n-1; i++)
        printf("%d ", a[i]);
    printf("%d\n", a[n-1]);
    return 0;
}
int main()
{
	int n,i,j,l,d;
	scanf("%d",&n);
	long int a[100001];
	for(i=1;i<=n;i++)
	{
		scanf("%d",&a[i-1]);
	}
	scanf("%d",&d);
	l=0;
	for(j=0;j<n;j++)
	{
		if(a[j]==d)
		{
			for(int k=j;k<n;k++)
			{
				a[k]=a[k+1];
			}
			l++;
		}
		if(a[j]==d)
			j--;
	}
	for(int m=0;m<n-l-1;m++)
	{
		printf("%d ",a[m]);
	}
	printf("%d",a[n-l-1]);
	return 0;
}
/*
 * ???? 1000012845_25.cpp
 * ???????
 * ????: 2010-10-29
 * ???????????
 */

int main() //???
{   //?????
	int n,i,j=0,k,m;  //??n,i,j,k,m???
	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(m=i;m<n;m++)
        	{a[m]=a[m+1];}
        	i--;
        	j++;
        }           //?????
    }
    for(i=0;i<n-j;i++)
    	{
    	cout<<a[i];
    	if(i!=n-j-1)
    		cout<<" ";
    	}
        cout<<endl;  //????
    return 0;
}   //?????
void main ()
{
	int n,a[100000],m,i,k=0;
	int *p,*q;
	scanf ("%d",&n);
	for (i=0;i<n;i++)
	scanf ("%d",&a[i]);
	scanf ("%d",&m);
	for (p=a;p<a+n-k;p++)
	{
		if (*p==m)
		{
			k++;
			for (q=p;q<a+n-k;q++)
			{
				*q=*(q+1);
			}
			p--;
		}
	}
	for (i=0;i<n-k-1;i++)
	{
		printf ("%d ",a[i]);
	}
	printf ("%d",a[i]);
}
int main()
{
	int n;
	cin >> n;
	int a[100000];
	int i, j, k;
	for (i = 0; i<= n - 1; i++)
	{
		cin >> a[i];
	}
	cin >> k;
	for (i = n - 1; i >= 0; i--)
	{
		if (a[i] != k)
		{
			j = i;
			break;
		}
	}
	for (i = 0; i <= n - 1; i++)
	{
		if (a[i] != k)
		{	
			if (i != j)
				cout << a[i] << " ";
			else
				cout << a[i] << endl;
		}
	}
	return 0;
}
void main()
{
	int n,i,j,k,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)
		{
			j=i;
			for (j;j<n;j++)
				a[j]=a[j+1];
			    n=n-1;
				i=i-1;
		}	
	}
	if (n!=0)
	{
	for (i=0;i<n-1;i++)
		printf("%d ",a[i]);
		printf("%d",a[n-1]);
	}
}
int main()
{
	int a[100000],n,i,t,k,m=0,*p;
	scanf("%d",&n);
	p=a;
	for(i=0;i<n;i++)
		scanf("%d",&*(p+i));
	scanf("%d",&k);
	for(i=0;i<n;i++)
	{
		if(*(p+i)==k)
		{
		for(t=i;t<n;t++)
			*(p+t)=*(p+t+1);
		m=m+1;
		i=i-1;
		}
	}
	for(i=0;i<n-1-m;i++)
		printf("%d ",*(p+i));
	printf("%d",*(p+i));
	return 0;
}
int main()
{
    int n;
    int a,b=0;
    int arr[100001];
    scanf("%d",&n);
    for( int i=0;i<n;i++ )
    {
         scanf("%d",&arr[i]);     
    }
    scanf("%d",&a);
    for( int i=0;i<n;i++ )
    {
         if( arr[i]!=a )
         {
             b++;
         }
    }
    for( int i=0;i<n;i++ )
    {
         if( arr[i]!=a )
         {
             if( b==1 )
             {
                 printf("%d\n",arr[i]);
                 break;
             }
             else printf("%d ",arr[i]);
             b--;
         }
    }
}
int main(){
    int n;
    scanf("%d",&n);
    int *a=(int*)malloc(sizeof(int)*n);
    for(int i=0;i<n;i++){
       scanf("%d",&a[i]);
       }
    int k;
    scanf("%d",&k);
    int s=0;
    if(a[n-1]==k){
       a[n-1]=k+1;
       s=s+1;
       }
       
    for(int j=0;j<n;j++){
        if(a[j]==k){
           int p=j;
           while(p<n-1){
                a[p]=a[p+1];
                p++;
                }
           s=s+1;
           j=j-1;        
           }
        }
        
    for(int q=0;q<n-s;q++){
        
        if(q==0){
           printf("%d",a[q]);  
        }else{
           printf(" %d",a[q]);   
        }
    }
    return 0;
}
//********************************
//*???????????   **
//*????? 1300012707 **
//*???2013.10.30  **
//********************************
int main()
{
	int a[100001], n, num;
	cin >> n;
	for ( int i = 1; i <= n; i = i + 1)
	{
		cin >> a[i];
	}
	cin >> num;
	for ( int i = 1; i <= n; i = i + 1)
	{
		if ( a[i] == num)
		{
			n = n - 1;
			for ( int j = i; j <= n; j = j + 1)
			{
				a[j] = a[j + 1];
			}
			i = i - 1;
		}
	}
	for ( int i = 1; i <= n - 1; i = i + 1)
	{
		cout << a[i] << " ";
	}
	cout << a[n] << endl;
	return 0;
}
/**************************************************
?? ???1300017667
?? 20131030
?? ????????
**************************************************/
int main()
{
	int n, i, j, k, count = 0;
	int num[100000] = {0};				//???????????100000??
	cin >> n;
	for(i = 0; i <= n - 1; i ++)		//???????
		cin >> num[i];
	cin >> k;
	for(i = 0; i <= n - 1; i ++)
	{
		if(num[i] == k)					//??????????????????????????????
		{
			for(j = i; j < n - 1; j ++)
				num[j] = num[j + 1];
			i --;						//????????????????????
			n --;						//?????1
		}
	}
	for( i = 0; i <= n - 1; i ++, count ++)
	{
		if(count != 0)					//????????????????????????
			cout << " ";
		cout << num[i];
	}
	return 0;
}
int main()
{
	int n,k;
	cin>>n;
	int a[n];
	for(int t=0;t<=n-1;t++){
		cin>>a[t];
	}
	cin>>k;
	int number=0,b=0;
	for(int i=0;i<=n-1;i++){
		if(a[i]!=k){number=number+1;
		}}
		for(int i=0;i<=n-1;i++){
		if(a[i]!=k){b=b+1;cout<<a[i];
		if(b<number)cout<<" ";}
			}return 0;

}
int main()
{
	int a[100001] , n , i = 1, j , k , count;
	cin >> n;
	count = n;
	for (i =1 ; i <=n ; i++)
	{
		cin >> a[i];
	}
	cin >> k;
	i = 1;
	do 
	{
		if (a[i] == k)
		{
			for (j = i ; j <= count - 1 ; j++)
			{
				a[j] = a[j + 1];
			}
			a[count] = 0;
			count = count -1;
			i = i -1;
		}
		i++;
	}while (i <= count);
	for (i = 1 ; i <= count - 1 ; i++)
	{
		cout << a[i] << " ";
	}
	cout << a[count] <<endl;
	return 0;
}
/*
 * 1.cpp
 *????????
 *  Created on: 2012-11-6
 *      Author: ???
 */
int main()
{
	int N,k,i,j,m;
	cin>>N;
	const int n=N;
	int a[n];
	for(i=0;i<n;i++)
		cin>>a[i];//????????
	cin>>k;
	for(j=0;j<n;j++)
	{
		if(a[j]!=k)

		{
			cout<<a[j];
			m=j+1;
			break;//????????k?????????
		}
	}
	for(m;m<n;m++)
	{
		if(a[m]!=k)
			cout<<" "<<a[m];//?????k???
		}

}
void main()
{
int n,k,i,j,sum=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-sum;i++)
{
	if(a[i]==k)
	{
		for(j=i+1;j<n-sum;j++)
		{
			a[j-1]=a[j];
		}
		sum=sum+1;
		i--;
	}
}
for(i=0;i<n-sum-1;i++)
{
	printf("%d ",a[i]);
}
printf("%d",a[n-sum-1]);
}
int main()
{
	int i,j,k,m,n,num=0;
	scanf("%d",&n);
	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)
		{
			m=i;
			for (j=i+1;j<n+1;j++,i++)
				a[i]=a[j];
			i=m-1;
			num=num+1;
		}
	}
	for(i=0;i<(n-num-1);i++)
		printf("%d ",a[i]);
	printf("%d",a[n-num-1]);
	return 0;
}
int main()
{
    int n,a[100001],k,i,j;
    scanf("%d",&n);
    for(i=1;i<=n;i++)
    {
                     scanf("%d",&a[i]);
    }
    scanf("%d",&k);
    for(i=1;i<=n;i++)
    {
                     if(a[i]==k)
                     {
                                for(j=i;j<n;j++)
                                {
                                a[j]=a[j+1];
                                }
                                n--;
                                i--;
                     }
    }
    for(i=1;i<n;i++)
    {
    printf("%d ",a[i]);
    }
    printf("%d\n",a[n]);
    getchar();
    getchar();
    getchar();
}
int main()
{
	 int i, j, k, n, a[100000] = {0};
     cin >> n;
     for(i = 0 ; i <= n - 1 ; i++)
     {
           cin >> a[i];
     }
     cin >> k;
     for(i = 0 ; i <= n - 1 ; )
     {
           if(a[i] == k)
           {
                   for(j = i ; j <= n - 1 ; j++)
                   {
                         a[j] = a[j+1] ;
                   }
                   n--;
           }
		   else
			   i++;
     }
     for(i = 0 ; i <= n - 2 ; i++)
     {
           cout << a[i] << " " ;
          
     }
           cout << a[n-1] ;
     return 0;
}
int main()
{
  int n;
  int i,j,t,k,b;
  cin >> n;
  int a[n];
  t=0;
  for(i=0;i<n;i++)
  {
    cin >> a[i];
  }
  cin >> b;
  i=0;
    while(i<n-t)
    {
     if(a[i]==b)
     { 
              for(k=i+1;k<n;k++)
       {
         a[k-1]=a[k];
       }
              t++;
       
     }
     else i++;
    }
  
  for(i=0;i<n-t-1;i++)
  {
    cout << a[i] << " ";
  }
  cout << a[n-t-1] << endl;
  cin.get(); cin.get();cin.get();
  return 0;
}
int main()
{
    const int max_size = 100000;
    int a[max_size];
    
    int len, k;
    cin >> len;
    for (int i = 0; i < len; ++i)
        cin >> a[i];
    cin >> k;
    
    int r1, r2;
    r1 = -1;
    for (int i = 0; i < len; ++i)
      if (a[i] != k)
      {
               ++r1;
               a[r1] = a[i];
      }
    
    for (int i = 0; i <= r1; ++i)
    {
        if (i != 0)
        {
              cout << " ";
        }
        cout << a[i];
    }
    return 0;
}
//********************************
//*???2.cpp   **
//*???????????   **
//*?????? 1300012838 **
//*???2013.10.30  **
//********************************

int main()
{ 
    int num[100000], n, k;
    cin >> n;
    for (int i = 0; i < n; i++)
    {
        cin >> num[i];
    }
    cin >> k;
    for (int j = 0; j < n; j++)
    {
        if (num[j] == k)
        {
            for (int l = j+1; l < n; l++)
            {
                num[l-1] = num[l];
            }
            n--;
            j--;
        }
    }
    cout << num[0];
    for (int p = 1; p < n; p++)
        cout << " " << num[p];
    cout << endl;

    return 0;                    
}
int main(){
	int a[100000], n, front=0, back=0, dltnumber, num=0;
	cin >> n;
	for(int i=0; i<n; ++i)
		cin >> a[i];
	cin >> dltnumber;
	while(back <n){
		while(a[back]!=dltnumber){
			a[front++] = a[back++];
		}
		while(a[back] == dltnumber && back <n){
			++back;
			++num;
		}
	}
	for(int i=0; i<(n-num); ++i){
		cout << a[i];
		if(i!=n-num-1)
			cout << " ";
	}
	return 0;
}
void main()
{
	int n,*p,a[100000],m,chongfu=0;
	scanf("%d",&n);
    for(p=a;p<a+n;p++)
	scanf("%d",p);
	scanf("%d",&m);
	for(p=a;p<a+n;p++)
	{
	
        if(*p==m)  chongfu++;
                  
         else if(*p!=m)  *(p-chongfu)=*p;
		 
	}
	for(p=a;p<a+n-chongfu-1;p++)
		printf("%d ",*p);
	printf("%d",*(a+n-chongfu-1));
}
int main()
{
	int a[100000];
	int t,k,n,i,j,l,s;
	cin >> n;
	for(i=1;i<=n;i++)
	{
		cin>>a[i-1];
	}
	cin >> k;
	for(t=1;t<=10;t++)
	{
	    for(j=0;j<=n-1;j++)
	    {
		    if(a[j]==k)
		    {
			    for(s=0;s<=n-2-j;s++)
			    a[j+s]=a[j+1+s];
			    n=n-1;
		    }
	    }
     }
	cout << a[0];
	for(l=1;l<=n-1;l++)
	{
		cout << " " << a[l];
	}
	return 0;
}
void main()
{
	int a[100000],i,j,k,n,t=0;
	scanf("%d",&n);
	for(i=0;i<n;i++)
	scanf("%d",&a[i]);
	scanf("%d",&k);
	
	for(i=0;i<n-t-1;i++){
		if(a[i]==k){
			for(j=i;j<n-t-1;j++)
			a[j]=a[j+1];
			t++;
			i--;
		}
	}
		if(a[i]==k){
		a[i]='\0';
		t++;
		}
		
	
	for(i=0;i<n-t-1;i++)
	printf("%d ",a[i]);
	printf("%d",a[i]);
}
/*DELETE NUMBERS
Author:??
Date:10/31*/
int main()
{
	int a[100000],i,n,k,j,count = 0;					     

	    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];
			i ++;
		}
		else
			count++;									    //?????????                                        //???????????
	}
	for(i = 0; i < n - count-1; i++)
	{
		cout << a[i] << " ";
	}
	if(i == n - count - 1) cout << a[i];
	return 0;
}