semeru/Code-Code-CloneDetection-POJ104 huggingface dataset:
/*
 *????delete elements in the array.cpp
 *?????
 *????: 2012-10-30
 *??????????????????????????????????????
      ?????????????????????????????
 */


int main(){
	//??????n???num??????k???a[10010]?????i,j,k,l?????time
	int n, num, k;
	int a[100010];
	int i = 0, j, l, m, time = 0;

	cin >> n;
	//???????????
	for (i = 0; i < n; i++)
	{
		cin >> num;
		a[i] = num;
	}
	cin >> k;
	//?a[0]?????????k?????????????????
	for (j = 0; j < n; j++)
	{
		if (a[j] == k)
		{
			for (m = j; m < n; m++)
			{
				a[m] = a[m+1];
			}
			j = j - 1;			//?????????????????????????????????
			time = time + 1;	//?????1
		}
	}
	//???????????k??????
	for (l = 0; l < n - time; l++)
	{
		if (l == 0)
			cout << a[l];
		else
			cout << " " << a[l];
	}
	return 0;
}
/*
 * delete.cpp
 *
 *  Created on: 2012-11-8
 *      Author: alias
 */
int main() {
	int n;//????n
	cin >> n;
	int a[n], m;//????
	for (int i = 0; i < n; i++)//????????
		cin >> a[i];
	int k;//????????
	cin >> k;
	for (int j = 0; j < n;j++) {
		if (a[j] == k) {//?a[0]???????????k
			for (m = j; m < n; m++) {//??????????????
				a[m] = a[m + 1];
			}
			n--;
			j--;//???j????
		}
	}
	for (int v = 0; v < n; v++) {//????k????
		if (v == 0)
			cout << a[v];
		else
				cout << " " << a[v];
	}
	return 0;
}
int main()
{
	int n,k,j,i;
	j=0;
	cin>>n;
	int a[n-1];
	for(i=0;i<n;i++)
		cin>>a[i];
	cin>>k;
	for(i=0;i<n-j;i++)
	{
		if(a[i]==k)
		{
		j=j+1;
		for(int t=i;t<n-j;t++)
			{
			a[t]=a[t+1];
			}
		a[n-j]=0;
		i=i-1;
		}
	}
	for(i=0;i<n-j;i++)
		{
		if(i==0)
			cout<<a[i];
		else
			cout<<" "<<a[i];
		}
	return 0;
}
int main()
{
	int a[100000];
	int n,k,i,j,l;                    //???????????
	l=0;                              //???????????????
	cin>>n;                           //??????????
	cout<<endl;
	for(i=0;i<n;i++)                  //????
		cin>>a[i];
	cout<<endl;
	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;}
int main()
{
	int n,sz[100000],k;
	int i,t=0,s=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){
		
        s++;
		}
	}
	for(i=0;i<n;i++){
		if(sz[i]!=k&&t!=s-1){
			printf("%d ",sz[i]);
			t++;
		}else if(sz[i]!=k&&t==s-1){
			printf("%d",sz[i]);
		}
	}
	return 0;
}
int main()
{
	int i,j,n,k,a[200000],x;
	cin >> n;
	for (i=1; i<=n; i++)
		cin >> a[i];
	cin >> k;
	i=1;
	x=n;
	while (i<=x-1)
	{
		if (a[i] == k)
		{
			for (j=i; j<=x-1; j++)
				a[j] = a[j+1];
			i--;
			x--;
		}
		i++;
	}
	if (a[x] == k)
	{
		for (i=1; i<=x-1; i++)
		if (i!=x-1)
		cout << a[i] <<' ';
		else cout << a[i];
	}
	else 
	{
		for (i=1; i<=x; i++)
		if (i!=x)
		cout << a[i] <<' ';
		else cout << a[i];
	}
	return 0;
}
int main()
{
	int a[100000],i,k,n,t,m,b=0;
	cin>>n;
	for(i=0;i<=n-1;i++)
		cin>>a[i];
	cin>>k;
	for(t=1;t<=100;t++)
	{
		for(i=0;i<=n-1;i++)
		{
			if(a[i]==k)
			{
				b++;
				for(m=i;m<=n-1;m++)a[m]=a[m+1];
			}
		}
	}
	cout<<a[0];
	for(i=1;i<=n-b-1;i++)cout<<" "<<a[i];
	return 0;
}
main(){
       int a[100000];
       int i,j,n,k,sum;
       scanf("%d",&n);
       sum=n;
       for(i=0;i<n;i++){
           scanf("%d",&a[i]);
       }
       scanf("%d",&k);
       for(i=0;i<sum;i++){
           if(a[i]==k){
               sum=sum-1;
               for(j=i;j<sum;j++){
                   a[j]=a[j+1];
               }
           i=i-1;
           }
       }
       for(i=0;i<sum-1;i++){
           printf("%d ",a[i]);
       }
       printf("%d",a[sum-1]);
}
int main()
{
	int n,a[100000],i,k,count=0;
	int *p;
	scanf("%d",&n);
	for(i=0;i<=n-1;i++)
		scanf("%d",&a[i]);
	scanf("%d",&k);
	for(p=a,i=0;i<=n-1;i++)                                                                                                                                                                                                                                                       
	{
		if(a[i]!=k)
		{
			*p=a[i];
			p++;
		}
		else 
		{count++;}
	}
	for(p=a;p<=(a+n-1-count);p++)
	{
		if(p==a)printf("%d",*p);
		else printf(" %d",*p);
	}
}
main()
{
	void move(int *p1, int x);//?p1???x???????
	long a[num],*p,i,j=0,k,n;
	scanf("%ld",&n);
	p=a;
	for (p=a;p<a+n;p++)
	{
		scanf("%ld",p);
	}
	scanf("%ld",&k);
	p=a;
	for (i=0;i<n-j;)
	{
		if (*(p+i)==k)
		{
			move(p+i,n-1-i);
			j++;
		}
		else
			i++;
	}
	for (p=a;p<a+n-j-1;p++)
	{
		printf("%ld ",*p);
	}
	printf("%ld",*p);
}
void move(int *p1, int x)
{
	int *c;
	for (c=p1;c<p1+x;c++)
	{
		*c=*(c+1);
	}
}
/*??????????????????????????????????????
 * ?????????????????????????????
 *????: 2012-10-29
 *??: ??
 */
int main()
{
	int n;
	cin >> n;
	int a[n], sum = n, k;
	for(int i = 0; i < n; i++)
		cin >> a[i];
	cin >> k;   //?????
	for(int j = 0; j < n; j++)
		if(a[j] == k)    //????????
		{
			for(int l = j; l < n; l++)
				a[l] = a[l + 1];   //??
			sum--;  //?????1
			j--;  //j???
		}
	cout << a[0];   //?????
	for(int m = 1; m < sum; m++)
		cout << " " << a[m];
	return 0;
}
void main()
{
	int n,a[100000],i,j,k,l,m,t;
	int *p;
	l=0;m=0;
	scanf("%d",&n);
	for (i=0;i<n;i++) scanf("%d",&a[i]);
	p=&a[0];
	scanf("%d",&k);
	for (i=0;i<n-l;i++)
	{
		if (m>=n) break;
		if (*(p+i)==k)
		{
			l++;
			for (j=i;j<n-l;j++) {t=*(p+j);*(p+j)=*(p+j+1);*(p+j+1)=t;}
			i--;
		}
		m++;
	}
	for (i=0;i<n-l;i++) {printf("%d",*(p+i));if (i!=n-l-1) printf(" ");}
}
void main()
{
 int i,j,m=0,n,a[100000],k,*p;
 p=a;
 scanf("%d",&n);
 for(i=0;i<n;i++)
  scanf("%d",p+i);
 scanf("%d",&k);
 for(i=0;i<n-m;i++)
 {
  if(*(p+i)==k) 
  {for(j=i+1;j<n-m+1;j++) *(p+j-1)=*(p+j);
   m++;i--;
  }
 }
  for(i=0;i<n-m-1;i++)
  printf("%d ",*(p+i));
  printf("%d",*(p+i));
}
int main()
{
    int  n, i, j, a[100000], k;
    cin >> n;
    for (i = 0; i < n; i++)
        cin >> a[i];
    cin >> k;
    for (i = 0; i < n; )
    {
        if (a[i] == k)
        {     
            for (j = i + 1; j < n ; j++)
                a[j - 1] = a[j];
			n--;
        }
        else
			i++;
    }
    for (int m = 0; m < n - 1; m++)
        cout << a[m] << " ";
	cout << a[n - 1];
    return 0;
}
int main()
{
	int n[100001], valid;
	cin >> valid;
	for (int i = 1; i <= valid; i++)
		cin >> n[i];
	int d;
	cin >> d;
	int j = 1, Do = valid;
	while (Do)
	{
		if (n[j] == d)
		{
			for (int k = j; k < valid; k++)
				n[k] = n[k + 1];
			valid--;
			Do--;
		}
		else
		{
			Do--;
			j++;
		}
	}
	for (int i = 1; i <= valid; i++)
	{
		cout << n[i];
		if (i - valid)
			cout << ' ';
	}

	return 0;
}
void main()
{
int i,j,m,k,str[100000];
scanf("%d\n",&m);
for(i=0;i<m;i++)
{
scanf("%d ",&str[i]);
}
printf("\n");
scanf("%d\n",&k);
for(j=0;str[j]==k;j++);
printf("%d",str[j]);
for(j=j+1;j<m;j++)
{
if(str[j]!=k)
{printf(" %d",str[j]);}
}
}
int main()
{
	int n,k,i,j,count=0;
	int *a;
	scanf("%d",&n);
	a=(int*)malloc(n*sizeof(int));
	for(i=0;i<=n-1;i++)
		scanf("%d",&a[i]);
	scanf("%d",&k);
	for(i=0;i<=n-1-count;i++)
	{
		if(a[i]==k)
		{
			count++;
			for(j=i+1;j<=n-count;j++)
				a[j-1]=a[j];
			i--;
		}
		/*printf("count=%d %d\n",count,a[i]);*/
	}
	printf("%d",a[0]);
	for(i=1;i<=n-1-count;i++)
		printf(" %d",a[i]);
	printf("\n");
	return 0;
}
int main()
{
	int n, i, k, j, m=0, h, l;
	cin >> n;
	int a[110000];
	for (i=1 ;i<=n;i++)
	{
		cin >> a[i];
	}
	cin >> k;
	for (j=n;j>=1;j--)
	{
		if (a[j]==k)
		{
			for (l=j;l<=n;l++)
			{
				a[l]=a[l+1];
			}
			m=m+1;
		}
	}
	for (h=1;h<=n-m;h++)
	{
		if (h==1)
			cout << a[h];
		else
			cout << " " << a[h];
	}
	return 0;
}
int main()
{
	int k,i,x;
	int a[999999];
	cin >>k;
	for(i=1;i<=k;i++)
	{
		cin>>a[i];
	}
	cin>>x;
	for(i=1;i<=k;i++)
	{
		if(a[i]!=x)
		{
			cout<<a[i];
		    goto loop;	
		}
	}
loop: i++;	
for(  ;i<=k;i++)
	{
		if(a[i]!=x)
			cout<<" "<<a[i];
	}
	return 0;

}
int main()
{
	int n, k;
	cin >> n;
	int a[100000];
	int i, j;
	int m;
	for (i = 0; i < n; i++)
	{
		cin >> a[i];
	}
	m = n;
	cin >> k;
	for (i = 0; i < m; i++)
	{
		if ( a[i] == k)
		{
			m = m - 1;
			for(j = i; j < n - 1; j++)
			{
				a[j] = a[j + 1];
			}
			i = i - 1;
		}
	}
	cout << a[0];
	for (i = 1; i < m; i++)
		cout << " " << a[i];
	return 0;
}
//**************************
//* ??? ????????*
//* ??? 1200012878      *
//* 11?2?                *
//**************************
int main()
{
	int n, a[100001], k, count, i, j, m, d;
	cin >> n;
	count = 0;
	for (i = 0; i <= n - 1; i++)
	{
		cin >> a[i];
	}
	cin >> k;
	for (j = 0; j <= n - 1 - count; j++)
	{
		if (a[j] == k)
		{
			for (d = j ; d < n - 1 - count; d++)
			{
				a[d] = a[d + 1];
			}
			count++;
			j = j - 1;
		}
	}
	for (m = 0; m <= n - 1 - count; m++)
	{
		if (m == n - 1 - count)
			cout << a[m];
		else
			cout << a[m] << " ";
	}
	return 0;
}
int main()
{
         int n,number[100001],x,sum=0;
		 cin>>n;
		 for(int i=0;i<n;i++)
		 {
			 cin>>number[i];
		 }
		 cin>>x;
		 for(int i=0;i<n;i++)
		 {
			 if(number[i]==x&&number[i+1]!=x){
				 for(int j=i;j<n;j++)
				 {
					 number[j]=number[j+1];
				 }
				 sum++;
			     }
			 else if(number[i]==x&&number[i+1]==x){
			for(int j=i;j<n;j++)
				 {
					 number[j]=number[j+1];
				 }
			 i--;
			 sum++;
			 }    
		 }
		 for(int i=0;i<n-sum-1;i++){
			 cout<<number[i]<<" ";}
		 cout<<number[n-sum-1];
		 return 0;
}
int main()
{
	int num[100000],n,del,rem;
	scanf("%d",&n);
	int i;
	for(i=0;i<=n-1;i++)
	scanf("%d",&num[i]);
	scanf("%d",&del);
	rem=n;
	int g;
	for(g=n-1;num[g]==del;g--)
	{
		rem-=1;
	}
	int e;
	for(e=0;e<=rem-1;e++)
	{
		while(num[e]==del)
		{
			int t;
			for(t=e;t<=rem-2;t++)
			{
				num[t]=num[t+1];
			}
			rem-=1; 
		}
	}
	int m;
	for(m=0;m<=rem-1;m++)
	{
		printf("%d",num[m]);
		if(m<=rem-2)
			printf(" ");
	}                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    
	return 0;
}
/*
 * ???????.cpp
 *
 *  Created on: 2011-10-19
 *      Author: Administrator
 */
int main()
{
	int i,n,s,j,k=0;
	cin>>n;
	int a[n];
	for(i=0;i<(n-1);i++)
	{
		cin>>a[i];
	}
	cin>>a[n-1];
	cin>>s;
	for(i=0;i<n;i++)
	{
		if(a[i]==s)
		{
			for(j=i;j<(n-k+1);j++){
				a[j]=a[j+1];
			}
			i=i-1;
			k=k+1;
		}
	}
	for(i=0;i<(n-k-1);i++)
	{
		cout<<a[i]<<" ";
	}
	cout<<a[n-k-1]<<endl;
	return 0;
}
void main()
{
	int n;
	scanf("%d",&n);
	int num[n],de;
	int i,j,k,t;
	for(i=0;i<n;i++)
	scanf("%d",&num[i]);
	scanf("%d",&de);
	for(i=0,j=0;i<n-j;i++)
	{
		if(num[i]==de)
		{
			for(k=i;k<n-j;k++)
			num[k]=num[k+1];
			j++;
			i--;
		}
	}
	for(i=0;i<n-j-1;i++)
	printf("%d ",num[i]);
	printf("%d\n",num[n-j-1]);
}
int main()
{
	int a[200000],b=0,n,i,j,k;
	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++;
			for (j=i+1;j<n+1;j++)
				a[j-1]=a[j];
			i--;
		}
	}
	for (i=0;i<n-b-1;i++)
		printf("%d ",a[i]);
	printf("%d",a[n-b-1]);
	return 0;
}
int main()
{
	int n,k;
	int *p,*head,*chuanwei;
	int remaining;
	scanf("%d",&n);
	remaining=n;
	p=(int *)calloc(n+1,sizeof(int));
	head=p;
	for(;p<head+n;p++)
		scanf("%d",p);
	scanf("%d",&k);
	for(p=head;p<head+remaining;p++)
	{
		while(*p==k&&p<head+remaining)
		{
			remaining--;
			for(chuanwei=p;chuanwei<head+remaining;chuanwei++)
			{
				*chuanwei=*(chuanwei+1);
			}
		}
	}
	for(p=head;p<head+remaining-1;p++)
	{
		printf("%d ",*p);
	}
	printf("%d",*p);
	return 0;
}
int main()
{
int n,count=1;
int a[100001];
int k;

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)
       {
            a[count]=a[i];
            count++;
       }
}

for(int i=1;i<=count-2;i++)
cout<<a[i]<<' ';
cout<<a[count-1];

return 0;
}
/*
 * asd.cpp
 *
 *  Created on: 2011-10-25
 *      Author: dell
 */

int main()
{
	long i, j, n, k, x, m = 0;
	cin>>n;
	long a[n];

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

	// ?????????X?
	// ??????X????????????????
	cin >> x;
	for (k = 0; k < n; k++)
	{
		if (a[k] == x)
		{
			m = m + 1;
			for (j = k; j < n; j++)
			{
				a[j] = a[j + 1];
			}
			k--;
		}
	}

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

	return 0;
}
main()
{
   long n,i,j,a[100000],k,x=0;
   scanf("%ld",&n);
   for(i=0;i<n;i++)scanf("%ld",&a[i]);
   scanf("%ld",&k);
   for(i=0;i<n-x;)
   { if(a[i]!=k){i++;continue;}
     if(a[i]==k&&i<n-1-x)
       {
	for(j=i+1;j<n-x;j++)a[j-1]=a[j];
	x++;
       }
       if(a[i]==k&&i==n-x-1){x++;break;}
   }
   if(n-x!=0){
   for(i=0;i<n-x-1;i++)printf("%ld ",a[i]);
   printf("%ld",a[n-x-1]);}


}
int a[100002];
int main()
{
	int n,k,i,m;
	cin>>n;
	for (i = 0;i<n;i++)
	     cin>>a[i];//???????;
    cin>>k;
    for (i = 0;i<n;i++)
    {
    	if (a[i]==k)
    	{
    		m = i;
    	for (i = m;i<n-1;i++)//??a[n]???k??;
    		a[i] = a[i+1];
    	a[i] = 0;//???n???
    	i=m-1;//?????????????;
    	n = n-1;//?????????;
    	}
    }
    for (i = 0;i<n;i++)
    {
    	if (i<n-1)
    		cout<<a[i]<<' ';
    	else if (i == n-1)
    		cout<<a[i];
    }
	return 0;
}
/*
 * ???1.cpp
 * Created on: 2012-10-28
 * Author: ???
 * ???????????
 */
int main(){
     int n,i,k,j=0,x;     //????
     cin>>n;                //??n
     int a[n];              //????
     for(i=0;i<=n-1;i++)    //????
     {
        cin>>a[i];         //????
     }
     cin>>k;               //??k
     i=0;                  //?i?0
     while(i<=n-1-j)       //????
    {
    	if(a[i]==k)        //????K
    	{
    		j=j+1;         //?j?1
    		for(x=i;x<=n-1-j;x++)   //????
    		a[x]=a[x+1];    //??????
    	}
    	else {                 //?????k
    		i=i+1;             //?i?1
    	}
    }
     for(i=0;i<=n-j-1;i++){   //????
    	 if(i==0)cout<<a[i]; //??????????
    	 else cout<<" "<<a[i]; //??????? ???????
     }
     return 0;            //????
}
int main(){
	int n,i,j,s,t,m,del,x,sum=0;
	cin>>n;
	int num[100001];
	for(i=0;i<=n-1;i++){
		cin>>num[i];
	}
	cin>>del;
	for(m=n;m<=100001;m++)
			num[m]=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;
}
/*
 * sanchushuzu.cpp
 *??????????
 *  Created on: 2012-11-2
 *      Author: ??
 */

int main() {
	int n, i, j = 0, k, num = 0;
	cin >> n;//????
	int a[n];//????
	for (i = 0; i < n; i++)
		cin >> a[i];
	cin >> k;//??
	for (i = 0; i < n; i++)
		if (a[i] != k)
			num++;
	for (i = 0; i < n; i++)
		if (a[i] != k) {
			a[j] = a[i];
			j++;
		}//????
	if (a[0] != k)
		cout << a[0];
	for (i = 1; i < j; i++)
		cout << " " << a[i];//??
	return 0;
}
int main()
{
	int a[200000]={0};
	int n=0,i=0,m=0,j=0,k=0;
	cin>>n;
	for(i=0;i<n;i++)
		cin>>a[i];
	cin>>m;
	for(i=0;i<n;i++)
	{
		if(a[i]==m)
		{
			k+=1;
			for(j=i;j<n-k+1;j++)
				a[j]=a[j+1];
		}
		if(a[i]==m)
			i=i-1;
		    //k+=1;
	}
		for(i=0;i<n-k;i++)
			if(i==n-k-1)
			cout<<a[i]<<endl;
			else
				cout<<a[i]<<" ";
		return 0;
}
int main() {
	int n;
	scanf("%d", &n);
	int number[NUMBER];
	int i=0;
	int count=0;
	while(i<n)
	{
		scanf("%d", &number[i]);
		i++;
	}
	int k;
	scanf("%d", &k);
	i=0;
	int j=0;
	while(i<n)
	{
		if(number[i]==k)
		{
			count++;
			while((i+j)<n)
			{
			   number[i+j]=number[i+j+1];
			   j++;
			}
		}
		else
		{
			i++;
		}
		j=0;

	}
	i=0;
	while(i<(n-count))
	{
		if(i==0)
		{
			printf("%d", number[i]);
			i++;
		}
		else
		{
			printf(" %d", number[i]);
			i++;
		}
	}



	return 0;
}
int main(int argc, char* argv[])
{
	int n,k,i;
	scanf("%d",&n);
	int *a=(int *)malloc(sizeof (int)*n);
	for(i=0;i<n;i++)
	{
		scanf("%d",&a[i]);
	}
	scanf("%d",&k);
	int x=0;
	for(i=0;i<n;i++)
	{
		if(a[i]!=k)
		{
			if(x==0)
			{
				printf("%d",a[i]);
				x++;
			}
			else 
			{
				printf(" %d",a[i]);
			}
		}
	}
	free(a);
	return 0;
}
/*
 * ????????????.cpp
 * ?????
 * ????: 2012-10-29
 * ???????????
 */
int main(){											//?????
	int a[100000];									//????a[100000]
	int n=1,k=1,m=1,i=0,j=0,t=0;					//???????
	cin>>n;											//??n
	for(i=0;i<n;i++){							//?????????
		cin>>m;
		a[i]=m;
	}
	cin>>k;											//??k
	for(j=0;j<n;j++){							//???????
		if(a[j]==k){									//????????k
			for(t=j;t<n;t++){
				a[t]=a[t+1];								//??????
			}
			j--;
			n--;										//???j?n??
		}
		else continue;									//????
		}
	cout<<a[0];											//?????????
	for(i=1;i<n;i++){
		cout<<" "<<a[i];								//??????
	}
	return 0;
}													//?????
//????????
int main()
{
	int a[100001]={0}, b, n, k=0, j;//b????????n??????a[]???,
	cin>>n;
	for(int i = 0;i <= n-1;i++)//?????????
	{
		cin>>a[i];
	}
	cin>>b;//????????
	for(j = 0;j <= (n-1);j++)//???????????????????
	{
		if(a[j] != b)
		{
			cout<<a[j];
			break;
		}
	}
	for(int l = j+1;l<=(n-1);l++)//???????????
	{
		if(a[l] != b)
			cout<<" "<<a[l];
	}
return 0;
}
int main()
{
	int n,i,*p,k,m,j;
	scanf("%d",&n);
	m=n;
	p=(int*)malloc(n*sizeof(int));
	for(i=0;i<n;i++)
	{
		scanf("%d",(p+i));
	}
    scanf("%d",&k);
	for(i=0;i<m;i++)
	{
		if(*(p+i)==k)
		{
			for(j=i;j<m-1;j++)
			{
				*(p+j)=*(p+j+1);
			}
			i--;
	    	m--;
		}
	}
	for(i=0;i<m-1;i++)
	{
		printf("%d ",*(p+i));
	}
    printf("%d",*(p+m-1));
	return 0;
}
void main()
{
      int a[1000000];
      int i,n,del,j;
int *p;
      scanf("%d",&n);
      for(i=0;i<n;i++)
      {
       scanf("%d",&a[i]);
       }
       scanf("%d",&del);
      p=a;
       for(i=0;i<n;i++)
      {
                           if(a[i]==del) 
                           {
                             for(j=i;j<n;j++)   
                             a[j]=a[j+1];
                             i--;
                             n--;}
       }
      for(i=0;i<n-1;i++,p++)
      printf("%d ",*p);
      printf("%d",*p);
}
int main()
{   int i=0,n,j,x;
	long int a[100000];
	scanf("%d",&n);
	printf("\n");
	for(i=0;i<n;i++){
		scanf("%ld",&a[i]);
	}
	i=0;
	printf("\n");
	scanf("%d",&x);
	while(i<n){
		if(a[i]==x){
			n=n-1;
			for(j=i;j<n;j++){
				a[j]=a[j+1];
			}
			i=i-1;
		}
		i++;
	}
	printf("%ld",a[0]);
	for(i=1;i<n;i++){
		printf(" %ld",a[i]);
	}
	return 0;
}
/*
 * ????first.cpp
 * ??????
 * ?????2010-11-2
 * ????????????
 */


int main(){//?????
	int e=0,s,i,k;//??????
	cin>>s;//??????
	int a[s];//????
	for (i=0;i<s;i++)//??????????
	    cin>>a[i];
	cin>>k;//???????
	for (i=0;i<s;i++)//????????
	{
		if (a[i]==k){
			int m=i;
			for(;m>0;m--)//??????????
			a[m]=a[m-1];//??????
			e++;//e???????????
			a[m]=0;
		}
	}
	for(i=e;i<s-1;i++)//?????????
	{
		cout<<a[i]<<" ";
	}
	cout<<a[s-1];
}
int main()
{
	int n,k,i,j;
	int c1=0;
	int c2=0;
	int a[100000];
	scanf("%d",&n);
	for (i=0;i<n;i++)
	   scanf("%d",&a[i]);
    scanf("%d",&k);
    for (i=0;i<n;i++){
       if (a[i]==k) c2++;
    }
    for (i=0;i<n;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=0;i<n-c2-1;i++)
	   printf("%d ",a[i]); 
	   printf("%d",a[n-c2-1]);
return 0;	   
}
void main()
{
	long n,k,t,i,j,p;
	long a[1000000];
	scanf("%ld",&n);
	for(i=0;i<n;i++)
		scanf("%ld",&a[i]);
	scanf("%ld",&k);
	p=0;
	for(i=0;i<n;i++)
		if(a[i]==k)
			p++;
	i=0;
	while(i<n)
	{
		if(a[i]==k)
		{
			for(j=i+1;a[j]==k;j++);
			t=a[i];
			a[i]=a[j];
			a[j]=t;
			i++;
		}
		else i++;
	}
	for(i=0;i<n-p-1;i++)
		printf("%ld ",a[i]);
         printf("%ld",a[n-p-1]);
}
void main()
{
	int n,a,i,b,s;
	int *p,*q,*m;
    p=(int *)malloc(100000*sizeof(int));
	s=0;
	scanf("%d",&n);
	for(i=0;i<n;i++)
	{
		scanf("%d",&a);
		p[i]=a;
	}
	q=p;
	scanf("%d",&b);


	for(i=0;i<n;)
	{
		if(*q==b)
		{
			for(m=q;m<q+n-i;m++)
			{
				*m=*(m+1);
			}
			s=s+1;

		}
		else
		{i++;
		q++;}
	}
   q=p;
   printf("%d",*q);
   q++;
   for(i=1;i<n-s;i++,q++)
	   printf(" %d",*q);
   
}
int main ()
{
	int a[100001] = {0};
	int n, i, k, sum;
	cin >> n;
	for ( i = 1; i <= n; i ++) //?????
		cin >> a[i];
	cin >> k;
	sum = 1;                   //sum????????1
	for ( i = 1; i <= n; i ++)
	{
		if ( a[i] != k ) //??????sum??
		{
			a[sum] = a[i];
			if (sum != 1)
				cout << ' ';//????????
			cout << a[sum];
			sum ++;
		}
	}
	return 0;
}
int main()
{
	 long n,k,i,num=0,a[100001];
	scanf("%ld",&n);
	for(i=0;i<n;i++)
		scanf("%ld",&a[i]);
	scanf("%ld",&k);
	long *p1,*p2;
	long *max;//???????????????????
	max=a+n;
	for(p1=a;p1<max;p1++) //??????????????????????????
		if(*p1==k) 
			{num++;
			for(p2=p1;p2<(a+n);p2++)
				*p2=*(p2+1); p1--;}
	max=a+n-num-1;
	for(p1=a;p1<max;p1++)//???????
	printf("%ld ",*p1);
	printf("%ld",*p1);
}
//********************************
//*????????             **
//*????? 1300012848        **
//*???2013.10.30             **
//********************************
int main()
{
	int n, i = 0, j = 0, k, m = 0, p = 0, l, cnt = 0;
	cin >> n;
	int b[100000];
	for (; i < n; i++)
		cin >> b[i];
	cin >> k;
	for (; j < n; j++)
		if(b[j] == k)
			cnt++; //?k??????cnt? ??n?????cnt???
	for (l = 0; l < n - cnt; l++) //???????n-cnt?? 
		for (m = p; m < n; m++) //????????k??????????
			if (b[m] != k)
			{
				b[l]=b[m];
				p = m + 1;
				break; //???b[l]??????????
			}
	for (l = 0; l < n - cnt; l++)
	{
		cout << b[l];
		if(l < n - cnt - 1)
			cout << " ";
	}
	return 0;
}
int judge(int x);
int main()
{
	int n,i,j;
	scanf("%d",&n);
	for(i=3;i<=n/2;i++)
	{
		if(judge(i)==1)
		{
			j=n-i;
			if(judge(j)==1)
			{
				printf("%d %d\n",i,j);
			}
		}
	}
	return 0;
}

int judge(int x)
{
	int i,q=1;
	for(i=2;i<x;i++)
	{
		if(x%i==0)
		{
			q=0;
			break;
		}
	}
	return q;
}
int main()
{
	int m,a[1000]={0},b,c,d,e,i;
	scanf("%d",&m);
	i=1;a[0]=3;
	for(b=5;b<=15+m/2;b=b+2)
	{
		c=0;
		for(d=2;d<=sqrt(b);d++)
		{
			if(b%d==0) c++;
		}
		if(c==0)
		{
			a[i]=b;i++;
		}
	}
	b=i;
	for(e=0;a[e]<=m/2;e++)
	{
		i=m-a[e];c=0;
		for(d=2;d<=sqrt(i);d++)
		{
			if(i%d==0) c++;
		}
		if(c==0)
		{
			printf("%d %d\n",a[e],i);
		}
	}
	return 0;
}
int z(int n)
{
	int i,t,r;
	t=0;
	r=(int)sqrt(n)+1;
	for(i=3;i<=r;i=i+2)
	{
		if(n%i==0)
		{
			t++;
			break;
		}
	}
	if(t==0)
		return(1);
	else
		return(0);
}
int main()
{
	int m,i,j;
	scanf("%d",&m);
	for(i=3;i<=m/2;i=i+2)
	{
		if(z(i))
		{
			j=m-i;
			if(z(j))
			printf("%d %d\n",i,j);
			
		}
	}
	
	return 0;
}
int f(int n)
{
    int i,a;
    a=sqrt(n);
    for(i=2;i<=a;i++)
    {
            if(n%i==0)  return 0;
    }
    return 1;
}
int main()
{
    int n;
    scanf("%d",&n);
    int i;
    for(i=3;i<=(n/2);i++)
    {
          
          if(f(i)&&f(n-i)) printf("%d %d\n",i,(n-i));
    }
    getchar();
    getchar();
    getchar();
}
int main()
{
int m,a,b,i,k;
scanf("%d",&m);
for(a=3;a<=m/2;a=a+2)
   {
    b=m-a;
    i=2;
    k=2;
       while(i<=a-1) 
       { 
         if(a%i==0) 
         break;
         else
          
            i=i+1;
        }
        while(k<=b-1) 
       { 
         if(b%k==0) 
         break;
         else
          {if(k==b-1&&i==a)
           printf("%d %d\n",a,b);}
             k=k+1;
       }
 
   }
}
int main()
{
    int prime(int x);
    int n,p=3,q,num;
    scanf("%d",&n);
    for (p=3;p<=(n/2);p=p+2)
      {
         q=n-p;
         if (prime(p)==1&&prime(q)==1)
           printf("%d %d\n",p,q);   
         else 
           continue;
      }
   }
int prime (int x)
{
    int i,k;
    k=(int)sqrt(x);
    for (i=2;i<=k;i++)
    {
        if (x%i==0)
        break;
    }
    if (i==k+1)
      return 1;
    else
      return 0;
}
int main()
{
	int panduan(int x);
    int m,i,j,a,b;
	scanf("%d",&m);
	for(i=3;i<=m/2;i=i+2)
	{
		j=m-i;
		a=panduan(i);
		b=panduan(j);
		if((a==1)&&(b==1))
			printf("%d %d\n",i,j);
	}
    return 0;
}
int panduan(int x)
{
	int i;
	for(i=3;i<x/2;i++)
		if(x%i==0)
		{
			return(0);break;
		}
	return(1);
}