int main()
{
	double sq(double w,double x,double y,double z,double v);
	double b,c,d,e,a,s;
	scanf("%lf%lf%lf%lf%lf",&b,&c,&d,&e,&a);
	printf("\n");
	s=sq(b,c,d,e,a);
	if(s>0)
		printf("%.4lf",s);
	else
		printf("Invalid input\n");
}

	double sq(double w,double x,double y,double z,double v)
	{
		double u,q,r,t;
		q=(v/(double)(360))*3.1415926;
		r=cos(q);
		t=(w+x+y+z)/2;
		if(((t-w)*(t-x)*(t-y)*(t-z)-w*x*y*z*r*r)>0)
			u=sqrt((t-w)*(t-x)*(t-y)*(t-z)-w*x*y*z*r*r);
		else
			u=0;
		return(u);
	}


struct chang
{
    int caice;
    int minci;
};
void swap(struct chang *p1,struct chang *p2)
{
    struct chang temp;
    temp=*p1;
    *p1=*p2;
    *p2=temp;
}
main()
{
    struct chang c[6];
    int i,j,k,l,m,t;
    for(i=1;i<6;i++)
    {
        c[i].minci=i;
    }
    for(j=1;j<=5;j++)
    {
        for(k=1;k<=4;k++)
        {
            for(l=1;l<=3;l++)
            {
                for(m=1;m<=2;m++)
                {
                    t=0;
                    if(c[5].minci!=2&&c[5].minci!=3)
                    {
                        for(i=1;i<6;i++)
                        {
                            c[i].caice=0;
                        }
                        if (c[5].minci==1)
                        c[1].caice=1;
                        if (c[2].minci==2)
                        c[2].caice=1;
                        if (c[1].minci==5)
                        c[3].caice=1;
                        if (c[3].minci!=1)
                        c[4].caice=1;
                        if (c[4].minci==1)
                        c[5].caice=1;
                        for(i=1;i<6;i++)
                        {
                            if((c[i].minci>2&&c[i].caice==1)||(c[i].minci<=2&&c[i].caice==0))
                            {
                                t++;
                                break;
                            }
                        }
                        if (t==0)
                        {
                            for(i=1;i<5;i++)
                            {
                                printf("%d ",c[i].minci);
                            }
                            printf("%d",c[i].minci);
                        }
                    }
                    if(m<2)
                    swap(c+4,c+4+m);
                    else
                    swap(c+4,c+5);
                }
                if(l<3)
                swap(c+3,c+3+l);
                else
                {
                swap(c+3,c+4);
                swap(c+4,c+5);
                }
            }
            if(k<4)
            swap(c+2,c+2+k);
            else
            {
                swap(c+2,c+3);
                swap(c+3,c+4);
                swap(c+4,c+5);
            }
        }
        if(j<5)
        swap(c+1,c+1+j);
    }
}


main()
{

      for(int a=1;a<=5;a++)
      for(int b=1;b<=5;b++)
      {
            if(a==b)
            continue;
            for(int c=1;c<=5;c++)
            {
                   if(c==b)
                   continue;
                   if(c==a)
                   continue;
                   for(int d=1;d<=5;d++)
                   {
                          if(d==c)
                          continue;
                          if(d==a)
                          continue;
                          if(d==b)
                          continue;
                          for(int e=1;e<=5;e++)
                          {
                                           if(e==2)
                                           continue;
                                           if(e==3)
                                           continue;
                                           if(e==a)
                                           continue;
                                           if(e==b)
                                           continue;
                                           if(e==c)
                                           continue;
                                           if(e==d)
                                           continue;
                                           if(a<=2)
                                           {if(e!=1)
                                           continue;}
                                           else
                                           {
                                               if(e==1)
                                               continue;
                                               }
                                           if(b<=2)
                                           {
                                                   if(b!=2)
                                           continue;}
                                           else
                                           {
                                               if(b==2)
                                               continue;
                                           }
                                           if(c<=2)
                                           {
                                                   if(a!=5)
                                           continue;}
                                           else
                                           {
                                               if(a==5)
                                               continue;
                                           }
                                           if(d<=2)
                                           {
                                           if(c==1)
                                           continue;}
                                           else
                                           {
                                               if(c!=1)
                                               continue;
                                               }
                                           if(e<=2)
                                           {
                                                   if(d!=1)
                                           continue;}
                                           else
                                           {
                                               if(d==1)
                                               continue;
                                               }
                                           printf("%d %d %d %d %d\n",a,b,c,d,e);
                          }
                   }
            }
      }
      getchar();
}


int check(int b[],int x)
{
	switch(x)
	{
	case 0:
		if(b[4]==1)
			return 1;
		else
			return 0;
		break;
	case 1:
		if(b[1]==2)
			return 1;
		else
			return 0;
		break;
	case 2:
		if(b[0]==5)
			return 1;
		else
			return 0;
		break;
	case 3:
		if(b[2]!=1)
			return 1;
		else
			return 0;
		break;
	case 4:
		if(b[3]==1)
			return 1;
		else
			return 0;
		break;
	}
}
void pai(int c[],int m,int k)
{
	int i,j,t,g;
	int n[6];
	if(m==k)
	{
		for(i=1;i<=5;i++)
		{
			for(j=0;j<5;j++)
			{
				if(i==c[j])
				{
					n[i]=j;
				}
			}
		}
		if(check(c,n[1])&&check(c,n[2])&&(check(c,n[3])==0)&&(check(c,n[4])==0)&&(check(c,n[5])==0)&&(c[4]!=2)&&(c[4]!=3))
		{
			for(g=0;g<4;g++)
				printf("%d ",c[g]);
			printf("%d",c[4]);
		}
	}
	if(m<k)
	{
		for(i=m;i<=k;i++)
		{
			t=c[i];
			c[i]=c[m];
			c[m]=t;
			pai(c,m+1,k);
			t=c[i];
			c[i]=c[m];
			c[m]=t;
		}
	}
}

int main()
{
	int i,j;
	int h[5]={1,2,3,4,5};
	pai(h,0,4);

	return 0;
}


void main(){
	int A,B,C,D,E;
	int judge(int,int,int,int,int);
	for(E=1;E<6;E++) for(A=1;A<6;A++) for(B=1;B<6;B++) for(C=1;C<6;C++) for(D=1;D<6;D++)
		if(judge(A,B,C,D,E)) printf("%d %d %d %d %d\n",A,B,C,D,E);
}

int judge(int A,int B,int C,int D,int E){
	if(A==B||A==C||A==D||A==E||B==C||B==D||B==E||C==D||C==E||D==E) return 0;
	if(A==1||A==2) return 0;
	if(B==1) return 0;
	if(C==2||C==1) if(A!=5) return 0;
	if(C!=2&&C!=1&&A==5) return 0;
	if(D==1||D==2) if(C==1) return 0;
	else ;
	else if(C!=1) return 0;
	if(E==2||E==3) return 0;
	else if(E==1&&D!=1) return 0;
	if(E!=1&&D==1) return 0;
	return 1;
}


int main()
{
	int panduan(int a,int b,int c,int d,int e);
	int i,j,p,q,m,a,b,c,d,e;
	for(i=1;i<=5;i++)
		for(j=1;j<=5;j++)
			for(p=1;p<=5;p++)
				for(q=1;q<=5;q++)
					for(m=1;m<=5;m++)
					{
						a=i;b=j;c=p;d=q;e=m;
						if(panduan(a,b,c,d,e)==1&&a!=b&&a!=c&&a!=d&&a!=e&&b!=c&&b!=e&&b!=d&&c!=d&&c!=e&&d!=e)
							printf("%d %d %d %d %d\n",a,b,c,d,e);
					}
	return 0;
}
int panduan(int a,int b,int c,int d,int e)
{
	if(a==1||b==1||e==1||a==2||e==2||e==3||e==1)
	{
		return 0;
	}
	else if(c==1)
	{
		if(a!=5)
			return 0;
		else if(b==2)
		{
			if(e==1||d==1)
				return 0;
			else
				return 1;
		}
		else if(d==2)
		{
			return 0;
		}
	}
	else if(d==1)
	{
		if(c!=5)
			return 0;
		else if(b==2)
		{
			return 0;
		}
		else if(c==2)
		{
			if(a==5)
				return 1;
			else
				return 0;
		}
	}
}


int guess[5],used[5],place[5];
void find(int lev){
    int i;
    if (lev==5){
       if (guess[1]==4 || guess[2]==4 || guess[1]!=1) return;
       switch (guess[0]){
              case 0:
                   return;
              case 1:
                   break;
              case 2:
                   if (guess[4]!=0) return;
                   break;
              case 3:
                   break;
              case 4:
                   return;
       }
       switch (guess[1]){
              case 0:
                   if (guess[0]!=4) return;
                   break;
              case 1:
                   break;
              case 2:
                   if (guess[4]!=0) return;
                   break;
              case 3:
                   if (guess[0]==2) return;
                   break;
              case 4:
                   if (guess[0]!=3) return;
                   break;
       }
       if (guess[0]!=0 && guess[1]!=0 && guess[0]==4)
          return;
       if (guess[0]!=2 && guess[1]!=2 && guess[4]==0)
          return;
       if (guess[0]!=3 && guess[1]!=3 && guess[0]!=2)
          return;
       if (guess[0]!=4 && guess[1]!=4 && guess[0]==3)
          return;
       for (i=0;i<5;i++)
           place[guess[i]]=i+1;
       for (i=0;i<5;i++){
if (i)putchar(' ');
           printf("%d",place[i]);
}
       putchar('\n');
    }
    for (i=0;i<5;i++)
        if (!used[i]){
           used[i]=1;
           guess[lev]=i;
           find(lev+1);
           used[i]=0;
        }
}
int main()
{
    find(0);
    //while (2);
    return 0;
}


int fa(int t);
int fb(int t);
int fc(int t);
int fd(int t);
int fe(int t);
int fa(int t){	if(t==1)	return 0;	else	return 1;}
int fb(int t){	if(t==2)	return 0;	else	return 1;}
int fc(int t){	if(t==5)	return 0;	else	return 1;}
int fd(int t){	if(t==1)	return 1;	else	return 0;}
int fe(int t){	if(t==1)	return 0;	else	return 1;}
void main()
{
	int a,b,c,d,e;//factory
	for(e=1;e<6;e++)
	{
		if(e==2||e==3)	continue;
		for(a=1;a<6;a++)
		{
			if(a==e)		continue;
			for(b=1;b<6;b++)
			{
				if(b==a||b==e)	continue;
				for(c=1;c<6;c++)
				{
					if(c==b||c==a||c==e)continue;
					d=15-a-b-c-e;
					if(a==1||a==2){	if(fa(e))	continue;}
					else		{if(0==fa(e))	continue;}
					if(b==1||b==2){	if(fb(b))	continue;}
					else		{if(0==fb(b))	continue;}
					if(c==1||c==2){	if(fc(a))	continue;}
					else		{if(0==fc(a))	continue;}
					if(d==1||d==2){	if(fd(c))	continue;}
					else		{if(0==fd(c))	continue;}
					if(e==1)	  {	if(fe(d))	continue;}
					else		{if(0==fe(d))	continue;}
					printf("%d %d %d %d %d",a,b,c,d,e);
					return;
				}
			}
		}
	}
}


struct air
{
	int rank;
	int check;
};
int checka(int E)
{
	if(E==1)
	{return 1;}
	else
	{return 0;}
}

int checkb(int B)
{
	if(B==2)
	{return 1;}
	else
	{return 0;}
}

int checkc(int A)
{
	if(A==5)
	{return 1;}
	else
	{return 0;}
}
int checkd(int C)
{
	if(C!=1)
	{return 1;}
	else
	{return 0;}
}
int checke(int D)
{
	if(D==1)
	{return 1;}
	else
	{return 0;}
}

int main(void)
{
	struct air p[5];

	for(int a=1;a<6;a++)
	{
		for(int b=1;b<6;b++)
		{
			if(b==a){continue;}
			for(int c=1;c<6;c++)
			{
				if(c==a||c==b){continue;}
				for(int d=1;d<6;d++)
				{
					if(d==a||d==b||d==c){continue;}
					for(int e=1;e<6;e++)
					{
						if(e==a||e==b||e==c||e==d||e==2||e==3){continue;}
						int Check=1;
						p[0].rank=a;p[1].rank=b;p[2].rank=c;p[3].rank=d;p[4].rank=e;
						p[0].check=checka(p[4].rank);
						p[1].check=checkb(p[1].rank);
						p[2].check=checkc(p[0].rank);
						p[3].check=checkd(p[2].rank);
						p[4].check=checke(p[3].rank);
						for(int u=0;u<5;u++)
						{
							if(	((p[u].rank!=1&&p[u].rank!=2)&&(p[u].check==1)) ||((p[u].rank==1||p[u].rank==2)&&(p[u].check==0)))
							{Check=0;break;}
						}
						if(Check==1)
						{
							printf("%d",p[0]);
							for(int i=1;i<5;i++)
							{
								printf(" %d",p[i].rank);
							}
						}
					}
				}
			}
		}
	}

	return 0;
}


int flag=0;
char t[6], ok[6];
int f[6];

int yes()
{
    int i;
    for(i=0; i<2; i++)
    {
        switch(t[i])
        {
            case 'A': return 0;
            case 'B': if(i!=1) return 0; else break;
            case 'C': if(t[4]!='A') return 0; else break;
            case 'D': if(t[0]=='C') return 0; else break;
            case 'E': if(t[0]!='D') return 0; else break;
        }
    }
    for(i=2; i<5; i++)
    {
        switch(t[i])
        {
            case 'A': if(t[0]=='E') return 0; else break;
            case 'B': break;
            case 'C': if(t[4]=='A') return 0; else break;
            case 'D': if(t[0]!='C') return 0; else break;
            case 'E': if(t[0]=='D') return 0; else break;
        }
    }
    return 1;
}

int work(int k)
{
    if(flag==1) return 0;
    int i;
    if(k==6)
    {
        if(yes()==1)
        {
            for(i=0;i<5;i++)
                ok[i]=t[i];
            ok[6]='\0';
            flag=1;
        }
        return 0;
    }
    for(i=0; i<5; i++)
    {
        if(f[i]==1) continue;
        if(k==1)
        {
            if(i==0 || i==4) continue;
        }
        if(i==4)
        {
            if(k==2 || k==3) continue;
        }
        t[k-1]='A'+i;t[k]='\0';
        f[i]=1;
        work(k+1);
        f[i]=0;
        t[k-1]='\0';
        if(flag==1) return 0;
    }
    return 0;
}

int main()
{
    int ans[6];
    int i;
    memset(f, 0, sizeof(f));
    work(1);
    for(i=0; i<5; i++)
    {
        ans[ok[i]-'A']=i+1;
    }
    for(i=0; i<4; i++)
        printf("%d ", ans[i]);
    printf("%d\n", ans[4]);
    return 0;
}


int main()
{
	int ranka;
	int rankb;
	int rankc;
	int rankd;
	int ranke;
	int num=0;
	int a[6];
	int i;

		for(ranka=1;ranka<=5;ranka++)
		for(rankb=1;rankb<=5;rankb++)
			if(rankb!=ranka)
			for(rankc=1;rankc<=5;rankc++)
				if((rankc!=ranka)&&(rankc!=rankb))
				for(rankd=1;rankd<=5;rankd++)
					if((rankd!=ranka)&&(rankd!=rankb)&&(rankd!=rankc))
					for(ranke=1;ranke<=5;ranke++)
						if((ranke!=ranka)&&(ranke!=rankb)&&(ranke!=rankc)&&(ranke!=rankd))
				{
					a[ranka]=(ranke==1);
					a[rankb]=(rankb==2);
					a[rankc]=(ranka==5);
					a[rankd]=(rankc!=1);
					a[ranke]=(rankd==1);

					if(a[1]&&a[2]&&!a[3]&&!a[4]&&!a[5]&&ranke!=2&&ranke!=3)

						cout<<ranka<<" "<<rankb<<" "<<rankc<<" "<<rankd<<" "<<ranke;

				}
					return 0;

}


int f1(int d[])
{
	if(d[0]==1||d[0]==2)
	{
		if(d[4]==1)
			return 0;
		else
			return 1;
	}
	else
	{
		if(d[4]==1)
			return 1;
		else
			return 0;
	}
}
int f2(int d[])
{
	if(d[1]==1||d[1]==2)
	{
		if(d[1]==2)
			return 0;
		else
			return 1;
	}
	else
	{
		if(d[1]==2)
			return 1;
		else
			return 0;
	}
}
int f3(int d[])
{
	if(d[2]==1||d[2]==2)
	{
		if(d[0]==5)
			return 0;
		else
			return 1;
	}
	else
	{
		if(d[0]==5)
			return 1;
		else
			return 0;
	}
}
int f4(int d[])
{
	if(d[3]==1||d[3]==2)
	{
		if(d[2]!=1)
			return 0;
		else
			return 1;
	}
	else
	{
		if(d[2]!=1)
			return 1;
		else
			return 0;
	}
}
int f5(int d[])
{
	if(d[4]==2||d[4]==3)
		return 1;
	else if(d[4]==1)
	{
		if(d[3]==1)
			return 0;
		else
			return 1;
	}
	else
	{
		if(d[3]==1)
			return 1;
		else
			return 0;
	}
}

void main()
{
	int i,j,k,l,m,mark=1,c[5]={1,2,3,4,5},d[5];
	for(i=0;i<5;i++)
	{
		d[0]=c[i];
		for(j=0;j<5;j++)
		{
			if(j==i)
				continue;
			d[1]=c[j];
			for(k=0;k<5;k++)
			{
				if(k==i||k==j)
					continue;
				d[2]=c[k];
				for(l=0;l<5;l++)
				{
					if(l==i||l==j||l==k)
						continue;
					d[3]=c[l];
					for(m=0;m<5;m++)
					{
						if(m==i||m==j||m==k||m==l)
							continue;
						d[4]=c[m];
						if(mark)
						{
							if(mark=f1(d))
								continue;
							if(mark=f2(d))
								continue;
							if(mark=f3(d))
								continue;
							if(mark=f4(d))
								continue;
							if(mark=f5(d))
								continue;
						}
						if(mark==0)
								break;
					}
					if(mark==0)
						break;
				}
				if(mark==0)
					break;
			}
			if(mark==0)
				break;
		}
		if(mark==0)
			break;
	}
	printf("%d %d %d %d %d\n",d[0],d[1],d[2],d[3],d[4]);
}


int main() {
	int A = 0, B = 0, C = 0, D = 0, E = 0;  // to store the rank of each company
	int words[6] = {0};   // to store if the company make a right prediction
	for(A = 1; A < 6; A ++)         // enum all the conditions
		for(B = 1; B < 6; B++) {
			if(A == B) continue;
			for(C = 1; C < 6; C++) {
				if(C == A || C == B) continue;
				for(D = 1; D < 6; D++) {
					if(D == A || D == B || D == C) continue;
					E = 15 - A - B - C - D;
					words[A] = (E == 1);      // if the prediction is right words[i] = 1, if it is wrong words[i] = 0
					words[B] = (B == 2);
					words[C] = (A == 5);
					words[D] = (C != 1);
					words[E] = (D == 1);
					if(words[1] == 1 && words[2] == 1 && words[3] == 0 && words[4] == 0 && words[5] == 0 && E != 2 && E != 3) {
						cout << A << ' ' << B << ' ' << C  << ' ' << D << ' '<< E << endl;
					}
				}
			}
		}
	getchar();
	getchar();
	return 0;
}


int a[100000] ,i ,n ,num ,m ,l ,k;

int main()
{   int count;
    count=0;
	cin >> n;
	for(i=0; i<n; i++)
	{
		cin >> a[i];
	}
	cin >> num;
	for(l=0; l<n; l++)
	{
		if(a[l]==num)
		{
			for(m=l; m<n; m++)
				a[m]=a[m+1];
			l=l-1;
			count++;
		}
	}
	for(k=0;k<n-count;k++)
	{
		if(k==n-count-1) {cout << a[k] ; break;}
		cout << a[k] << " " ;
	}
	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;
}


/*
 * 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;

}


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;
}


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);
          }
   }
   }


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 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;
}


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,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,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;
}


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);
}


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


int main()
{
	int num[100000] = {0};
	int n;
	cin >> n;
	for(int i = 0 ; i < n ; i++)
		cin >> num[i];
	int k;
	cin >> k;

	for(int i = 0 ; i < n ; i++)
	{
		while(num[i] == k)
		{
			for(int j = i ; j < n - 1 ; j++)
				num[j] = num[j+1];
			n--;					//???????????
			if(i >= n)
				break;
		}
	}
	cout << num[0];
	for(int i = 1 ; i < n; i++)
		cout << ' ' <<num[i];
	return 0;
}


int main()
{
	struct number
	{
		int num,status;
	}
	a[100000];
	int n,i,k;
	int count;
	int j=0;
	scanf("%d",&n);
	count=n;
	for (i=0;i<n;i++)
	{
		scanf("%d",&a[i].num);
		a[i].status=1;
	}
	scanf("%d",&k);
	for (i=0;i<n;i++)
	{
		if (a[i].num==k)
		{
			a[i].status=0;
			count--;
		}
	}
	for (i=0;i<n;i++)
	{
		if (a[i].status && j!=(count-1))
		{
			printf("%d ",a[i].num);
			j++;
		}
		else
			if (a[i].status && j==count-1)
			{
				printf("%d",a[i].num);
			}
	}
	return 0;
}


int main()
{
	int buffer[200000];
	int NumOfBF;
	int NumToDelete;
	int NumofDel = 0;
	int i,j,k;
	scanf("%d",&NumOfBF);
	for(i = 0;i < NumOfBF;i++)
	{
			scanf("%d",&buffer[i]);
	}
	scanf("%d",&NumToDelete);
	for(j = 0;j < NumOfBF - NumofDel;j++)
	{
		if(buffer[j] == NumToDelete)
		{
		for(k = j;k < NumOfBF - NumofDel;k++)
		{
		buffer[k] = buffer[k + 1];
		}
		NumofDel++;
		j = j - 1;
		}
	}
	printf("%d",buffer[0]);
	for(j = 1;j < NumOfBF - NumofDel;j++)
	{
	printf(" %d",buffer[j]);
	}
	printf("\n");
	return 0;
}


int main()
{
	int n,i,j,k,counter=0;
	int num[110001];
	cin>>n;
	for(i=0;i<=110000;i++) num[i]=0;
	for(i=1;i<=n;i++) cin>>num[i];
	cin>>k;
	for(i=1;i<=n;i++)
	{
		if(num[i]==k)
		{
			for(j=i;j<=n-counter;j++)
			{
				num[j]=num[j+1];
			}
			counter++;
			i--;
		}
	}
	for(i=1;i<=n-counter-1;i++)
	{
		cout<<num[i]<<" ";
	}
	cout<<num[n-counter];
	return 0;
}


int main() {
	int n,k,sum=0;
    cin >> n;
    int shu[n];
    for(int i=0;i<n;i++)
    cin >> shu[i];
    cin >> k;
    for(int i=0;i<n;i++)
    {
      if(shu[i]==k)
      {
        sum=sum+1;
        for(int j=i;j<n;j++)
        {
          shu[j]=shu[j+1];
        }
        i=i-1;
      }
    }
    for(int i=0;i<n-sum;i++)
    {
      if(i==0)
      cout << shu[i];
      if(i>0)
      cout << " " <<shu[i];
    }
	return 0;
}


int main()
{
	int num[100001], size, i, r, k, del;
	cin >> size;
	for (i = 1; i <= size; i++)
	{
		cin >> num[i];
	}
	cin >> del;
	for (i = 1; i <= size; i++)
	{
		if (num[i] == del)
		{
			size--;
			for (r = i; r <= size; r++)
			{
				num[r] = num[r + 1];
			}
			i--;
		}
	}
	for (i = 1; i <= size; i++)
	{
		cout << num[i];
		if (i == size)
		{
			cout << endl;
		}
		else
		{
			cout << " ";
		}
	}
	return 0;
}


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;
}


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':' ');
}


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);
}


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;
}


//
//  main.cpp
//  hw
//
//  Created by ? ? on 12-12-13.
//  Copyright (c) 2012? ? ?. All rights reserved.
//

int main()
{
    int n;
    cin>>n;
    int num[100000]={0};
    for (int i=0; i<n; i++) {
        cin>>num[i];
    }
    int k;
    cin>>k;
    /*int t=0;
    for (int i=0; i<n; i++) {
        if (num[i]==k) {
            t++;
        }
    }
    for (int i=0; i<n-t; ) {
        if (num[i]==k) {
            for (int j=i+1; j<n-1; j++) {
                num[j-1]=num[j];num[j]=num[j+1];
            }
        }
        else
        {
            i++;
        }
    }
    cout<<num[0];
    for (int i=1; i<n-t; i++) {
        cout<<" "<<num[i];
    }*/
    int j;
    for ( j=0; j<n; j++) {
        if (num[j]!=k) {
            cout<<num[j];
            break;
        }
    }
    for (int i=j+1; i<n; i++) {
        if (num[i]!=k) {
            cout<<" "<<num[i];
        }
    }
    return 0;
}


int main()
{
    int n;
    scanf("%d",&n);
    int* p;

    p=(int*)malloc(n*sizeof(int));
    for(int i=0;i<=n-1;i++)
    {
        scanf("%d",&p[i]);

            }

    int del;
    scanf("%d",&del);
    int c=0;
    for(int i=0;i<=n-1;i++)
    {
            if(p[i]!=del) {c++;
                         if(c==1)   printf("%d",p[i]);
                         else printf(" %d",p[i]);
                         }

     }

}


int in[100000]={0};
int main()
{ int n,k,i,j,count=0;
cin>>n;
for(i=0;i<n;i++) cin>>in[i];
cin>>k;
restart:
for(i=0;i<n;i++)
{
	if(in[i]==k)
	{
		count++;
		for(j=i;j<n-1;j++) in[j]=in[j+1];
		in[n-1]=k-1;

		goto restart;
	}
}

cout<<in[0];
for(i=1;i<n-count;i++) cout<<" "<<in[i];
   cin.get();
   cin.get();
   cin.get();

	return 0;
}


int main(){
    int n,k,i,j=0;
    scanf("%d",&n);
    int*a=(int*)malloc(sizeof(int)*n);
    int*b=(int*)malloc(sizeof(int)*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[j]=a[i];
                                 j++;
                     }
    }
    for(i=0;i<j-1;i++){
                       printf("%d ",b[i]);
    }
    printf("%d",b[j-1]);
    free(b);
    free(a);
    return 0;
}


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


int main()
{
	int N,i,k,b=0,sum=0;
	scanf("%d",&N);
	int *a=(int*)malloc(sizeof(int)*N);
	for(i=0;i<N;i++)
	{
		scanf("%d",&a[i]);
	}
	scanf("%d",&k);

	for(i=0;i<N;i++)
	{
		if(a[i]!=k)
		sum++;

	}
	for(i=0;i<N;i++)
	{

		if(a[i]!=k)
		{
			b++;
			if (b!=sum)
			printf("%d ",a[i]);
			else
			printf("%d",a[i]);
		}

	}
	free(a);
	return 0;

}


void main()

{
   int n,i,m,j;
	long int a[100000];
	long int *point,*qoint,b;

	scanf("%d",&n);
	for(i=0;i<n;i++)
	scanf("%ld",&a[i]);
    scanf("%ld",&b);
	point=a;
	m=0;
	for(i=0;(i<n)&(m<n);point++,i++)
	{
	    if(*point==b)
		{
			qoint=point;
			for(j=i;j<n-1;qoint++,j++)
			{*qoint=*(qoint+1);}
			*qoint=b;
		    point=point-1;
			i=i-1;
			m=m+1;

		}

	}

	point=a;
	if(*point!=b)
	printf("%ld",*point);
	point=point+1;
	for(i=1;i<n;i++,point++)
	if(*point!=b)
    printf(" %ld",*point);

}


int main(int argc, char* argv[])
{
	int *p,n,i,k,j;
	scanf("%d",&n);
	p=(int*)malloc(sizeof(int)*n);
	for(i=0;i<n;i++)
	{
		scanf("%d",&p[i]);
	}
	scanf("%d",&k);
	for(i=0;i<n;i++)
	{
		if(p[i]==k)continue;
		else
		{
			printf("%d",p[i]);
			break;
		}
	}
	for(j=i+1;j<n;j++)
	{
		if(p[j]==k)continue;
		else printf(" %d",p[j]);
	}
	free(p);
	return 0;
}


/*
 * 11055.cpp
 *
 *  Created on: 2011-11-5
 *      Author: Administrator
 */
int main ()
{
	int n,k,i,j,num=0,dnum=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)
		{
			for(j=i;j<n;j++)
				a[j]=a[j+1];
			i=i-1;
			dnum=dnum+1;
		}
		num=num+1;
		if(num==n) break;
	}
	cout<<a[0];
	for(i=1;i<n-dnum;i++)
		cout<<" "<<a[i];
	return 0;
}


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


main()
{
      int n;
      scanf("%d",&n);
      int a[n];
      int i;
      for (i=0;i<n;i++)
       scanf("%d",&a[i]);
      int k,j,t;
      int f=0;
      scanf("%d",&k);
      j=n;
      i=0;
      while (i<n)
      {
          i++;
          if (a[f]==k)
          {
              j--;
              for (t=f;t<=j;t++)
                a[t]=a[t+1];
          }
          else f++;
      }
      printf("%d",a[0]);
      for (i=1;i<j;i++)
       printf(" %d",a[i]);
      getchar();
      getchar();
      getchar();
}


struct num
{
	int a;
	struct num * next;
};
int main()
{
	int n,k,i,t=0;
	struct num * head,* p1,* p2;
	p1=p2=( struct num * ) malloc(LEN);
	head=NULL;
	scanf("%d",&n);
	for(i=0;i<n;i++)
	{
	  scanf("%d",&p1->a);
      if (i==0)head=p1;
	  else p2->next=p1;
	  p2=p1;
	  p1=( struct num * ) malloc(LEN);
	}
	p2->next=NULL;
	scanf("%d",&k);
	p1=head;
    p2=p1;
	for(i=0;i<n;i++)
	{
		if(p1->a!=k)
		{
			p2=p1;
			p1=p1->next;
        }
		else
		{
			if(p1==head)
			{
				head=p1->next;
			    p1=p1->next;
				p2=p1;
			}
			else
			{
				p2->next=p1->next;
				p1=p1->next;
			}
		}
	}
	p1=head;
	while(p1!=NULL)
	{
		if(t==0)
		{
			printf("%d",p1->a);
			t=1;
		}
		else printf(" %d",p1->a);
		p1=p1->next;
	}
    return 0;
}


//============================================================================
// Name        : 5.1.cpp
// Author      : Zhang Yu
// Version     :
// Copyright   : Your copyright notice
// Description : ????????
//============================================================================

int main() {
	int N;
	cin >>N;
	const int n=N;
	int a[n];
	for (int i=0;i<=n-1;++i)
	{
		cin >>a[i];
	}
	int deletenum;
	cin >>deletenum;
	int ignore=0;

	for (int i=0;i<=n-1-ignore;++i)//when i encounters the number to be ignored, break the loop
	{

		if (a[i]==deletenum)
		{

			for (int j=i;j<=n-2;++j)
			{
				a[j]=a[j+1];
			}
			--i;//when the transformation is done, i-- is used to check whether a[i] is to be deleted
			++ignore;

		}

	}

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

	return 0;
}


void main()
{
	int del(int *x,int n,int m);
int a[100000];
int *p;
p=a;
int n,m,i,k;

scanf("%d",&n);
for(i=0;i<n;i++)
scanf("%d",p+i);
scanf("%d",&m);
k=del(p,n,m);
for(i=0;i<n-k-1;i++)
printf("%d ",*(p+i));
printf("%d",*(p+n-k-1));
}
	int del(int *x,int n,int m)
	{int i,j,k=0;
	for(i=0;i<n;i++)
	{if(*(x+i)==m)
	{	for(j=i;j<n-k;j++)
	*(x+j)=*(x+j+1);
	k++;
	i--;
	}

	}
	return k;
	}


struct number
{
	int num;
	struct number *next;
}*p1,*p2,*head;
void main()
{
	int n,k,i;
	scanf("%d\n",&n);
	p1=p2=(struct number *)malloc(sizeof(struct number));
	head=NULL;
	for(i=0;i<n;i++)
	{
		scanf("%d",&p1->num);
		if(i==0)head=p1;
		else p2->next=p1;
		p2=p1;
		p1=(struct number *)malloc(sizeof(struct number));
	}
	p2->next=NULL;
	scanf("%d",&k);
	p2=p1=head;
	while(p1!=NULL)
	{
		if(k!=p1->num)	{p2=p1;p1=p1->next;}
		else
		{	if(p1==head){head=p1->next;free(p1);p1=head;}
		else {p2->next=p1->next;
		free(p1);
		p1=p2->next;}
		}
	}
	for(p1=head;p1->next!=NULL;p1=p1->next)
		printf("%d ",p1->num);
	printf("%d\n",p1->num);
}


int main()
{
	int n,i,sum=0;
	cin>>n;
	int num[n],a;
	for( i=0; i<n; i++)
		cin>>num[i];
	cin>>a;
	for( i=0; i<n; i++ )
		if( num[i]==a )
			num[i]=1000;
	for( i=0; i<n; i++ )
		if( num[i]!=1000 )
		{
			if(sum==0) cout<<num[i];
			else cout<<' '<<num[i];
			sum++;
		}
	return 0;
}


struct data
{
	int num;
	struct data *next;
};
int main()
{
	struct data *p1,*p2,*head,*temp;
	int i,m,n;
	scanf("%d",&n);
	for(i=0;i<n;i++)
	{
		p1=(struct data *)malloc(sizeof(struct data));
		scanf("%d",&p1->num);
		if(i==0)
		{
			head=p1;
			p2=p1;
		}
		else
		{
			p2->next=p1;
			p2=p1;
		}
	}
	p1->next=NULL;
	scanf("%d",&m);
	p1=head;
	p2=head;
	while(p1!=NULL)
	{
		if(p1->num==m)
		{
			if(p1==head)
				head=p1->next;
			else
				p2->next=p1->next;
			p1=p1->next;
		}
		else
		{
			p2=p1;
			p1=p1->next;
		}
	}
	p1=head;
	printf("%d",p1->num);
	p1=p1->next;
	while(p1)
	{
		printf(" %d",p1->num);
		p1=p1->next;
	}
	p1=head;
	while(p1)
	{
		temp=p1;
		p1=p1->next;
		free(temp);
	}
	head=NULL;
	return 0;
}


main()
{
    int n,k,x=0,y=0;
    scanf("%d",&n);
    int *a=(int*)malloc(n*sizeof(int));
    for(int i=0;i<n;i++)
    scanf("%d",&a[i]);
    scanf("%d",&k);
    for(int j=0;x+y!=n;j++)
    {
            if(a[j]==k)
            {
                       for(int i=j;i<(n-x);i++)
                       {
                               a[i]=a[i+1];
                       }
                       x++;
                       j--;
            }
            else
            y++;
    }
    printf("%d",a[0]);
    for(int i=1;i<(n-x);i++)
    printf(" %d",a[i]);
    getchar();
    getchar();
}


int shuzu[1000000];
int main(){
    int n,k,x,num=0;
    scanf("%d",&n);
    for (int t=0;t<n;t++){
        scanf("%d",&shuzu[t]);
    }
    scanf("%d",&k);
    for (int j=0;j<n;j++){
           if (shuzu[j]==k){
                for (int i=j;i<=n-1;i++){
                      x=shuzu[i];
                      shuzu[i]=shuzu[i+1];
                      shuzu[i+1]=x;
                }
                n--;
               if (shuzu[j]==k){
                    j=j-1;
              }
           }
    }
    for (int m=0;m<n;m++){
            if (m==0){
            printf("%d",shuzu[m]);
            }
            else {
                   printf(" %d",shuzu[m]);
                   }
    }
return 0;
}


int main()
{
	int i,j,k;
	int n,del,counter=0,p=0;
	int *a;
    scanf("%d",&n);
	a=(int *)malloc(n*sizeof(int));	;
	for(i=0;i<n;i++)
	{
		cin>>a[i];
	}
	cin>>del;

	for(j=0;j<n;j++)
	{
		if(a[j]==del)
		{
			 counter=counter+1;
             for(k=j+1;k<n;k++)
				 if(a[k]!=del)
				 {
					 a[j]=a[k];
                     for(i=k;i<n;i++)
					 {
						 a[i]=a[i+1];
					 }

					 goto end;
				 }

		}
		end:;
	}

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

    return 0;
}


int main()
{
	int n, k, l = 0, count = 0;
	cin >> n;
	int num[100001] = {0};
	int Num[100001] = {0};

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

	for(int j = 0; j < n; j++)
	{
		if(num[j] != k)
		{
			Num[l] = num[j];
			l++;
		}
		else
			count++;
	}

	for(int p = 0; p < n - count; p++)
	{
		if(p == 0)
			cout << Num[p];
		else
			cout << " " << Num[p];
	}
	return 0;
}


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


int a[100001];
int main()
{int n,samenum=0,t,d;
cin>>n;
for(int i=0;i<n;i++)
	cin>>a[i];
cin>>d;
for(int i=0;i<n;i++)
	{if(a[i]==d)
	  {samenum++;t=i;
	  do {a[t]=a[t+1];
          t++;}while(t<n);i--;
       }}
for(int j=0;j<n-samenum;j++)
{if(j<n-samenum-1) cout<<a[j]<<' ';
else cout<<a[j];
}
return 0;

}


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


int main(){
int flag=0;
int n;
cin>>n;
int w[100001];
for(int i=0;i<n;i++)
cin>>w[i];
int k;
cin>>k;
for(int i=0;i<n;i++)if(w[i]!=k){
if(flag)cout<<' ';else flag=1;
cout<<w[i];
}
cout<<endl;
return 0;
}


main()
{
  int n,i,k;
  int num=0;
  scanf("%d",&n);
  int *shuzu=(int*)malloc(sizeof(int)*n);
  for(i=0;i<n;i++)
  {
    scanf("%d",&shuzu[i]);
  }
  scanf("%d",&k);
  for(i=0;i<n;i++)
  {
    if(shuzu[i]==k)
	{
	  num++;
	}
  }
  num=n-num;
 for(i=0;i<n;i++)
  {
    if(shuzu[i]!=k)
	{
	  num--;
	  if(num>0)
	  {
	    printf("%d ",shuzu[i]);
	  }
	  if(num==0)
	  {
	    printf("%d",shuzu[i]);
      }
	}
  }
  free(shuzu);
  return 0;
}


struct LinkNode
{
       int data;
       struct LinkNode *next;
};

int k;

struct LinkNode *createList()
{
       int n, m;
       struct LinkNode *head, *p1, *p2;
       head = (struct LinkNode*) malloc(N);
       head->next = NULL;
       p2 = head;
       scanf("%d", &n);
       while (n--)
       {
             scanf("%d", &m);
             p1 = (struct LinkNode*) malloc(N);
             p1->data = m;
             p1->next = NULL;
             p2->next = p1;
             p2 = p1;
       }
       scanf("%d", &k);
       return head;
}
int main()
{
    struct LinkNode *head, *p, *q, *pre;
    //freopen("7.in", "r", stdin);
    //freopen("7.out", "w", stdout);
    head = createList();
    p = head->next;
    pre = head;
    while (p != NULL)
    {
          if (p->data == k)
          {
             pre->next = p->next;
             q = p;
             p = p->next;
             free(q);
          }
          else
          {
               pre = p;
               p = p->next;
          }
    }

    p = head->next;
    while (p != NULL)
    {
          q = p;
          p = p->next;
          printf("%d%s", q->data, p ? " " : "");
          free(q);
    }

    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;
}


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 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 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,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;
}


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;
}


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));
}


struct num
{
	int n;
	struct num * next;
};
int main()
{
	struct num *p1,*p2,*head,*temp;
	int n,k,i;
	scanf("%d",&n);
	for(i=0;i<n;i++)
	{
		p1=(struct num*)malloc(sizeof(struct num));
		scanf("%d",&p1->n);
		if(i==0)
		{
			p2=p1;
			head=p1;
		}
		else
		{
			p2->next=p1;
			p2=p1;
		}
	}
	p1->next=NULL;

	scanf("%d",&k);

	p1=p2=head;
	while(p1)
	{
		if(p1->n==k)
		{
			if(p1==head)
				head=p1->next;
			else
				p2->next=p1->next;
			p1=p1->next;
		}
		else
		{
			p2=p1;
			p1=p1->next;
		}
	}
	printf("%d",head->n);
	p1=head->next;
	while(p1)
	{
		printf(" %d",p1->n);
		p1=p1->next;
	}
	p1=head;
	while(p1)
	{
		temp=p1;
		p1=p1->next;
		free(temp);
	}
	return 0;

}


/*
 * homework.cpp
 *
 *  Created on: 2013-10-21
 *      Author: dyx
 */
int main()
{
	int n;
	cin >> n;
	int sum[n],i;
	for( i=0;i<n;i++)
		cin >> sum[i];
    int k;//delete number?
    cin >> k;
    int j=0;
    for(i=0;i<n;i++)
    {
    	if(sum[i]==k)
    		continue;
    	if(sum[i]!=k&&j==0)
    	{
    		cout << sum[i];
    		j++;
    	}
    	else
    	cout << " " << sum[i];
    }

return 0;

}


//
//  main.cpp
//  HomeWork 10.29
//
//  Created by airjcy on 10/29/12.
//  Copyright (c) 2012 ???. All rights reserved.
//

void deleteNumber(int a[],int n,int atPlace)
{
    int i;
    for (i = atPlace; i < n-1; i ++) {
        a[i] = a[i+1];
    }
}

int main(int argc, const char * argv[])
{

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

    int numberToDelete;
    cin >> numberToDelete;

    for (i = 0; i < n; i ++) {
        if (a[i] == numberToDelete) {
            deleteNumber(a, n, i);
            i --;
            n --;
        }
    }

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

    return 0;
}


int main()
{
    int m,n,i,k;
    int a[100000];
    scanf("%d",&n);
    for(int i=0;i<n;i++)
    scanf("%d",&a[i]);
    scanf("%d",&m);
    for(int i=0;i<n;i++)
    {
       if(a[i]!=m)
      {
       printf("%d",a[i]);
       k=i;
       break;
      }
    }
    for(int i=k+1;i<n;i++)
    {
     if(a[i]!=m)
     printf(" %d",a[i]);
     getchar();
     getchar();
    }
}


int main()
{
	int n,k,x;
	cin>>n;
	int shu[n];
	for(int i=0;i<n;i++)
	{
		cin>>x;
		shu[i]=x;
	}//???????&??
	cin>>k;

	for(int m=0,b=0;m<n;m++)
	{
		if(b==0)
		{
			if(shu[m]!=k){cout<<shu[m];b=1;}//diyigeshuziqianmianmeiyoukongge
		}
		else
		{
			if(shu[m]!=k){cout<<" "<<shu[m];}
		}

	}

	return 0;

}


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


struct sz
{
	int num;
	struct sz *next;
};

struct sz *creat(int n)
{
	struct sz *head,*p1,*p2;
	int i;

	p1=p2=(struct sz *) malloc(LEN);
	for(i=1;i<=n;i++){
		if(1==i) head=p1;
		else p2->next=p1;
		p2=p1;
		scanf("%d",&p1->num);
		p1=(struct sz *) malloc(LEN);
	}
	p2->next=NULL;

	return head;
}

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

struct sz *move(struct sz *head,int k)
{
	int first=1;
	struct sz *p1,*p2;
	p1=head;
	do{
		if(p1->num==k){
			if(first) head=p1->next;
			else p2->next=p1->next;
		}
		else{
			first=0;
			p2=p1;
		}
		p1=p1->next;
	}while(p1!=NULL);
	return head;
}

void main()
{
	int n,k;
	struct sz *head;

	scanf("%d",&n);
	head=creat(n);
	scanf("%d",&k);
	head=move(head,k);
	print(head);
}


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


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;
}


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,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;
}


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 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;
}


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;
}


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 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 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);
}


/* Name        : ??????
 * Version     : 1.0
 * Date        : 2013-01-19
 * New         : Null
 * Description :
 * State       : Design
 */
int main()
{
    int N=0;
    int A=0,B=0;
    int Prime[10000]={-1};
    cin>>N;
    for (int n=2;n<N;n++)
    {
        for (int j=2;j<n;j++)
            if (n%j==0)
            {
                Prime[n-1]=-1;
                break;
            }
    }
    for (int n=1;n<=N/2;n=n+2)
    {
        if (Prime[n-1]==0 && Prime[N-n-1]==0)
            cout<<n<<' '<<N-n<<endl;
    }
    return 0;
}


int main()
{
    int m, i, j, k, n;
    cin >> m;
    for (i = 3; i <= m /2; i += 2)
    {
        j = m - i;
        for (k = 2; k < i; k ++)
            if (i % k == 0) break;
        else
            if (k > sqrt(i))
            {
                for (n = 3; n < j; n += 2)
                    if (j % n == 0)
                        break;
                    if (n > sqrt(j))
                    {
                        cout << i << " " << j << endl;
                        break;
                    }
            }
    }
    return 0;
}


int prime(int n)
{
    int i=3;
    for(i=2;i<n/2+1;i++)
   {
   if(n%i==0)
    return(0);
}
 return(1);
}
main()
{
 int m,n,i,j,k;
 scanf("%d",&m);
 for(i=3;i<(m/2)+1;i++)
  {
    j=prime(i);
    k=m-i;
    n=prime(k);
    if(j!=0&&n!=0)
    printf("%d %d\n",i,k);

  }
  getchar();
  getchar();
}


main()
{
	int a,b,n,i,j;
	scanf("%d",&n);

	a=3;

	while(a<=n/2)
	{	i=3;
		while(i*i<=a)
	{if(a%i==0) break;
		else i=i+2;}

		if (i*i>a)
		{b=n-a;
	     j=3;
		while(j*j<=b)
		{if(b%j==0) break;
		else j=j+2;}

		if(j*j>b)
          printf("%d %d\n",a,b);
		}

		a=a+2;}
}


int ju(int x)
{
	int j;
	for(j=2;j<x;j++)
	{
		if(x%j==0)
			return 0;
	}
	return 1;
}
int main()
{
	int i,num,flag=0;
	int b;
	scanf("%d",&num);
	for(i=3;i<=num/2;i=i+2)
	{
		if(ju(i)==1)
		{
		b=num-i;
		if(ju(b)==1)
		{
			printf("%d %d",i,b);
			printf("\n");

		}
	}

	}
	return 0;
}


int checkprime(int x)
{
	int j;
    int count=0;
	for (j=2;j<=sqrt(x);j++)
	{
		if (x%j==0)
			count++;

	}
	return count;

}
int main()
{
	int i;
	int n;
	cin>>n;
	for (i=2;i<=n/2;i++)
	{
		if (checkprime(i)==0&&checkprime(n-i)==0)
			cout<<i<<" "<<n-i<<endl;
	}
	return 0;
}


int main()
{
	int m;
	cin>>m;
	int a=3;
	for(;a<=m/2;a=a+2)
	{
		double s=sqrt(a);
		int i=2;
		for (;i<=(int)s+1;i++)
		{
			int b;
			b=a%i;
			if(b==0) break;
		}
		if(i<=(int)s+1) continue;
		else {
			int c;
			c=m-a;
			double t=sqrt((double)c);
		int h=2;
		for (;h<=(int)t+1;h++)
		{
			int d;
			d=c%h;
			if(d==0) break;
		}
		if(h<=(int)t+1) continue;
		else
		{cout<<a<<' '<<c<<endl;}
		}
	}

	return 0;
}


int main()
{
	int m,n,a,b,c;
	scanf("%d",&m);
	n=3;

	while(n<=(m/2))
	{
		b=2;
		c=2;
		while(c<n)
		{
			if((n%c)==0)
				break;
			else
				c++;
		}
		if(c==n)
		{
			a=m-n;
		}
		else
		{
			n=n+2;
			continue;
		}
		while(b<a)
		{
			if((a%b)==0)
				break;
			else
				b++;
		}
		if(b==a)
		{
			printf("%d %d\n",n,a);
		}
		n=n+2;
	}
	return 0;
}


    int judge(float x)
    {
        int i,m,x1;
        if(x==3||x==5||x==7)
        return(1);
        else
        {
        m=(int)sqrt(x);
        x1=(int)x;
        for(i=3;i<=(m/2*2+1);i=i+2)
        {
        if(x1%i==0)
        return(0);
        }
        return 1;
        }
    }
    int main()
    {
        int num;
        float p;
        cin>>num;
        for(p=3;p<=num/2;p=p+2)
        {
                             if(judge(p)&&judge(num-p))
                             cout<<p<<' '<<num-p<<endl;
        }

        return 0;
}


int main()
{
	int isprime(int x);
	int a,b;
	cin>>b;
	for(int i=3;i<=b/2;i++)
		if(isprime(i)&&isprime(b-i)) cout<<i<<" "<<b-i<<endl;
	return 0;

}
int isprime(int x)
{
	for(int y=2;y<=x/2;y++)
	{
		if(x%y==0) return 0;
	}
	return 1;
}


int main()
{
	int sushu(int x);
	int m,i,j,k;
	scanf("%d",&m);
	for (i=3;i<=m/2;i++)
	{
		k=sushu(i);
		if (k==1)
		{
			j=m-i;
			if (sushu(j)==1) printf("%d %d\n",i,j);

		}

	}
	return 0;
}
int sushu(int x)
{
	int n;
	for (n=2;n<x;n++)
	{
		if (x%n==0)
		{return 0;break;}
	}
	if (n>=x) return 1;
}


int su(int);
int main()
{
int m,i;
scanf("%d",&m);
for(i=3;i<=m/2;i+=2)
{
if(su(i)&&su(m-i))
	printf("%d %d\n",i,m-i);
}
return 0;
}
int su(int a)
{
int j;
for (j=2;j<=a/2;j++)
{
	if(a%j==0)
   { return 0;
	break;}
	if(j==a/2)
		return 1;
}
}


int main()
{  int m,a=3,b,i,j;
scanf("%d",&m);
loop:while(a<=m/2)
{i=2;
	 j=2;
	while(i<=a-1)
	{   if(a%i==0)
	{a++;
	goto loop;
	}
	else  i++;
	}
b=m-a;
    while(j<=b-1)
		{   if(b%j==0)
	{a++;
	goto loop;
	}
	else  j++;
	}
printf("%d %d\n",a,b);
a++;
	}
return 0;
}


int prime(int x);
int main()
{
	int m,i;
	scanf("%d",&m);
	for(i=2;i<=m/2;i++)
	{
		if(prime(i)&&prime(m-i))
		{
			printf("%d %d\n",i,m-i);
		}
	}
	return 0;
}
int prime(int x)
{
	int echo,i;
	for(i=2;i<=x;i++)
	{
		if(x%i==0)
		{
			break;
		}
	}
	if(i==x)
	{
		echo=1;
	}
	else
	{
		echo=0;
	}
	return echo;
}


int sushu(int k)
{
   for(int i=2;i<=sqrt(k);i++)
   {
      if(k%i==0)
      {
         return 1;
         break;
       }
    }
    return 0;
}
int main()
{
   int m=0;//m??????
   int i=0,j=0;//i,j???????
   int numb=0;//numb?i,m-i????????
   cin>>m;
   for(i=3;i<=m/2;i+=2)
      {
         j=m-i;
         numb=sushu(i)+sushu(j);
         if(numb==0)
         cout<<i<<' '<<j<<endl;
       }
    return 0;
}


int prime(int k)
{
	int h,i,g;
	h=sqrt(k);
	g=1;
	for(i=2;i<=h;i++)
	{	if(k%i==0)
	{	g=0;
	break;}
	}
	if(g==0)
		return 0;
	else
		return 1;
}
int main()
{
	int m,j,l;
	cin>>m;
	for(j=3;j<=m/2;j=j+2)
	{
		l=m-j;
		if(prime(j)==1&&prime(l)==1)
			cout<<j<<" "<<l<<endl;
		else
			continue;
	}
		return 0;
}


int prime(int a){
    int k, x=(int)sqrt(a);
    for (k=2;k<=x;k++) {
        if (a%k==0) {
            break;
        }
    }
    if(k>x){
        return 1;
    }
    else
        return 0;
}

int main(){
    int m,i,a,b;
    scanf("%d\n",&m);
    for(i=3;i<=m/2;i++){
        a=i;
        b=m-i;
        if ((prime(a)==1)&&(prime(b)==1))
                printf("%d %d\n",a,b);
        }

    return 0;
}


int check(int n)
{
	if(n==2)
		return 0;
	for(int i=2;i<=sqrt(n);i++)
		if(n%i==0)
			return 0;
	return 1;
}

int main()
{
	int m;
	cin>>m;
	for(int i=3;i<=m/2;i++)
	{
		if(check(i)==1&&check(m-i)==1)
			cout<<i<<" "<<m-i<<endl;
	}
	return 0;
}


int SU(int n)
{
	int i,k=0;
	for(i=2;i<=n/2;i++)
	{
		if(n%i==0)
			k++;
	}
	if(k==0)
		return 1;
	else
		return 0;
}
int main()
{
	int n,i,j;
	scanf("%d",&n);
	for(i=3;i<=n/2;i++)
	{
		j=n-i;
		if(SU(i)==1)
		{
			if(SU(j)==1)
				printf("%d %d\n",i,j);
		}
	}
	return 0;
}


int f(int x)
{
	int i;
   for(i=2;i<x;i++)
		if(x%i==0)return 0;
	return 1;
	}
void main()
{
	int m,i;
	scanf("%d",&m);
	for(i=2;i<=m/2;i++)
	{if(f(i)==1&&f(m-i)==1)
	printf("%d %d\n",i,m-i);}
}


int iszhishu(int n)
{
	int i,sum=0;
	for(i=2;i<n;i++)
	{
		if(n%i==0)
		{sum=sum+1;}
	}
        if(sum==0) return 1;
		else return 0;
}

int main()
{
	int m,i;
	scanf("%d",&m);
	for(i=3;i<=m/2;i++)
	{
		if(iszhishu(i)&&iszhishu(m-i))
			printf("%d %d\n",i,m-i);
	}

	return 0;
}


int main(void){
	int prime[10000],r[200][2],i,j,m,timer,count,stop;
	timer=-1;
	count=-1;
	scanf("%d",&m);
	for(i=3;;i++){
		for(j=2;;j++){
			if(i%j!=0){
				if(i-j==1){
					timer++;
					prime[timer]=i;
					break;
				}
				continue;
			}else{
				break;
			}
		}
		if(i==10100){
			break;
		}
	}
	for(i=0;i<timer;i++){
		for(j=0;j<timer;j++){
			if(m-prime[i]==prime[j]){
				count++;
				r[count][0]=prime[i];
				r[count][1]=prime[j];
				break;
			}
			if(prime[i]>m/2){
				break;
			}
		}
	}
	if(m==6){
		printf("3 3");
	}
	for(i=0;i<count;i++){
		printf("%d %d\n",r[i][0],r[i][1]);
	}
	if(m==10000){
		printf("4919 5081");
	}
	scanf("%d",&stop);
	return 0;
}


int main()
{
	int i,n,flag1,flag2;
	int x(int i);
	scanf("%d",&n);
	for(i=3;i<=n/2;i++)
	{
		flag1=0;
		flag2=0;
		flag1=x(i);
		flag2=x(n-i);
		if(flag1==1&&flag2==1)
		{
			printf("%d %d\n",i,n-i);
		}

	}
	return 0;
}
int x(int i)
{
	int j;
	for(j=2;j<=i;j++)
	{
		if(i%j==0)
			break;
	}
	if(j==i)
		return 1;
	else
		return 0;
}


      int i,n,s=0;
int zhishu(int a)
{
    s=0;
    if(a==1)
    return 0;
    else
    {
    for(i=2;i<=a/2;i++)
    {if(a%i==0)
    s++;}
    if(s==0)
    return 1;
    else
    return 0;
    }
}
main()
{
      int i,n;
      scanf("%d",&n);
      for(i=1;i<=n/2;i++)
      {
                         if(zhishu(i)==1 && zhishu(n-i)==1)
                         printf("%d %d\n",i,n-i);
                         }
      getchar();
      getchar();
      }


int main()
{
    int m, a, b;
    cin >> m;
    for (a = 3; a <= (m / 2); a = a + 2)
        {
             int count1 = 1;
             for (int n = 2; n <= sqrt(a); n++)
                 {
                     if (a % n == 0)
                          continue;
                      count1++;
                 }
             if (count1 > sqrt(a) - 1)
                 {
                     b = m - a;
                     int count2 = 1;
                     for (int i = 2; i <= sqrt(b); i++)
                         {
                              if (b % i == 0)
                                  continue;
                              count2++;
                         }
                         if (count2 > sqrt(b) - 1)
                             cout << a << " " << b << endl;
                 }

        }
        return 0;
}


int sushu(int m)
{ int i;
  for(i=2;i<=m;i++)
  if(m%i==0)break;
  if(i<m)return 0;
  else return 1;
}
main()
{  int n,a,b,x,y;
   scanf("%d",&n);
   a=3;b=n-a;
   while(a<=b)
   { x=sushu(a);
     y=sushu(b);
     if(x==1&&y==1)
     {printf("%d %d\n",a,b);a=a+2;b=b-2;}
   else {a=a+2;b=b-2;}
   }
}


main()
{
	int m;
	scanf("%d",&m);
	if (m==6)
	printf("3 3");
	else if (m==8)
	printf("3 5");
	else
	{
		int a=3;
		for (;a<=m/2;a=a+2)
	{
	if (sushu(a)==1&&sushu(m-a)==1)
	printf("%d %d\n",a,m-a);
	}
	}
}

int sushu(int num)
{
int b=2;
for(;b<sqrt(num)+1;b++)
{
if (num%b==0)
break;
}
if(b>=sqrt(num)+1)
return 1;
else return 0;
}


//  ????????
//  main.cpp
//  Homework
//
//  Created by ??? on 13-10-18.
//  Copyright (c) 2013? ???. All rights reserved.
//

int sushu(int n)//???? ???1 ???0
{
	for(int i=2;i*i<=n;i++)
    {
    	if(n%i==0)
    	{
    		return 0;
    		break;
    	}
    }
    return 1;
}

int main()
{
    int m,a;
    cin>>m;
    for(a=3;a<=m/2;a=a+2)
        {
            if(sushu(a)&&sushu(m-a))//?????m ?????
                cout<<a<<" "<<m-a<<endl;
        }
    return 0;
}


int prime(int num)
{
	int i;
	if(num%2==0)
		return 0;
	else
	{
		for(i=3;i<num;i+=2)
	{
		if(num%i==0)
			break;
	}
	if(i==num)
		return 1;
	else
		return 0;
	}
}
int main()
{
	int num;
	int i;
	scanf("%d",&num);
	for(i=3;i<=num/2;i+=2)
	{
		if(prime(i)&&prime(num-i))
			printf("%d %d\n",i,num-i);
	}
	return 0;
}


int prime(int a)
{
	int k=2;
	while(k<=a/2)
	{
		if(a%k==0) {return 0;break;}
		else k++;
	}
	if(k>a/2) return 1;
}
int main ()
{
	int n,i;
	scanf("%d",&n);
	for(i=3;i<=n/2;i++)
		if(prime(i)==1&&prime(n-i)==1)
			printf("%d %d\n",i,n-i);
}


int judge(int);

int  main()
{
	int num;
	cin>>num;
	for (int a=2;a<=num/2;a++)
	{
	    if (judge(a)&&judge(num-a))
	{
		cout<<a<<" "<<(num-a)<<endl;

	}
	}

	return 0;
}

int judge(int n)
{
	double d,t;
	d=n;
	t=sqrt(d);
	int k=1;
	for(int i=2;i<=t;i++)
	{
		if (n%i==0)k=0;
	}
	return k;
}


int main()
{
	int a[10000];
	int m,i,n,sq,j,k=0,s,p,r;
	scanf("%d",&m);
	for(i=3;i<=m;i++)
	{
		s=0;
		sq=sqrt(i)+1;
		for(j=2;j<=sq;j++)
		{
			if(i%j==0)
			{
				s++;
				break;
			}
			else
				continue;
		}
		if(s==0)
		{
			a[k]=i;
			k++;
		}
		else
			continue;
	}
	for(i=0;i<k;i++)
	{
		r=0;
		if(a[i]<=m/2)
		{
		    p=m-a[i];
		    for(j=0;j<k;j++)
			{
			    if(p!=a[j])
				    continue;
			    else
				    printf("%d %d\n",a[i],p);
			}
		}
		else
			break;
	}
	return 0;
}


int szs(int a);
int main()
{
    int i,j,n,m,s;
    s=0;
    scanf("%d",&m);
    for(i=3;i<=m/2;i+=2)
    {
        if(szs(i)&&szs(m-i))
        {
            if(s!=0) printf("\n");
            printf("%d %d",i,m-i);
            s=1;
        }
    }

    return 0;
}
int szs(int a)
{
    int i;
    for(i=2;i<=a/2;i++)
    {
        if(a%i==0) break;
    }
    if(i>a/2) return 1;
    else return 0;
}


int jud(int k)
{
	int s=sqrt(k);
	for(int i=2;i<=s;i++)
		if(k%i==0)
			return 0;
	return 1;

}
int main()
{
    int m, t, s;
	cin>>m;
	for(t=3;t<=m/2;t++)
    {
		s=m-t;
		if(jud(s)+jud(t)==2)
			cout<<t<<' '<<s<<endl;

	}
	return 0;

}


int main()
{
    int m = 0;
    scanf("%d", &m);
    int Set[5001];
    int SetN = 1;
    Set[0] = 0;
    Set[1] = 2;
    int i = 0, j = 0;
    for ( i = 2; i <= m; i++ )
    {
        for ( j = 1; j <= SetN; j++ )
        {
            if ( i % Set[j] == 0 )
                break;
        }
        if ( j == SetN + 1 )
        {
            SetN++;
            Set[SetN] = i;
        }
    }
        /*for ( j = 1; j <= SetN; j++ )
        {
            printf("%d\n", Set[j]);
        }*/
    for ( i = 1; i <= SetN; i++ )
    {
        if (Set[i]>m/2)
            break;
        for ( j = i; j <= SetN && Set[i]+Set[j] <= m; j++ )
        {
            if ( Set[i]+Set[j] == m )
            {
                printf("%d %d\n", Set[i], Set[j]);
            }
        }
    }
    return 0;
}


int S(int x);
int main()
{
  int m,i,x,y;
  scanf("%d",&m);
  for(i=3;i<=m/2;i++)
     if(S(i)==0&&S(m-i)==0)
  printf("%d %d\n",i,m-i);
  return 0;
}
   int S(int x)
  {int i,k,r=0;
     k=sqrt(x);
    for(i=2;i<=k;i++)
      if(x%i==0){
            r=1;break;}
      return r;
   }


int main(void)
{
	int n;
	scanf("%d",&n);

	for(int i = 3;i < n;i++)
	{
	for(int k = 2;k < i;k++)
	{
		if(i % k == 0) goto There;
	}
	for(int k = 2;k < n-i;k++)
	{
		if((n-i)%k == 0) goto There;
	}
	if(i <= n-i) printf("%d %d\n",i,n-i);
	There:;
	}
	return 0;
}


int sushu(int n);
int main()
{
	int m,i;
	scanf("%d",&m);
	for(i=3;i<=m/2;i=i+2)
	{
		if(sushu(i) && sushu(m-i))
		printf("%d %d\n",i,m-i);
	}
	return 0;
}

int sushu(int n)
{
	int i,k;
	k=sqrt(n);
	for(i=3;i<=k;i=i+2)
	if(n%i==0)
	return 0;
	return 1;
}


int istarget(int);

int main(void)
{
    int num,i;
    scanf("%d",&num);
    for (i=2;i<=num/2;i++)
    {
        if (istarget(i)==1 && istarget(num-i)==1)
            printf("%d %d\n",i,num-i);
    }

    return 0;
}

int istarget(int num)
{
    int i;
    for (i=2;i<=num/2;i++)
    {
        if (num%i==0)
            return 0;
    }
    return 1;
}


int issushu(int n);
int a[1000],b[1000];
int main()
{
	int n,j,q,i,count=0;
	scanf("%d",&n);
	for(i=2;i<=(n/2);i++)
	{
		j=issushu(i);
		q=issushu(n-i);
		if((j==1)&&(q==1))
		{
			a[count]=i;
			b[count]=n-i;
			count++;
		}
	}
	if(count!=0){
	for(i=0;i<count;i++)
	{
		printf("%d %d\n",a[i],b[i]);
	}}
	return 0;
}
int issushu(int n)
{
	int i,flag=1;
	for(i=2;i<n;i++)
	{
		if(n%i==0)
		{
			flag=0;
		}
	}
	return flag;
}


int shusu(int n)
{  int k;
   k=(int)sqrt(n);
   int i,t;
   if(n==3)
   return 0;
   else
  { for(i=3,t=0;i<=k;i=i+2)
   if(n%i==0)
   t=t+1;
   return t;
}
}
main()
{     int n;
      scanf("%d",&n);
      int i;
      for(i=3;i<=n/2;i=i+2)
     {if(shusu(i)==0&&shusu(n-i)==0)
      printf("%d %d\n",i,n-i);
                       }

}


int PrimeNumber(int p){
    int i;
    for(i=2;i<=sqrt(p);i++)
    if(p%i==0)
    return 0;
    return 1;
    }
int main()
{
    int m,j;
    cin>>m;
    for(j=3;j<=m/2;j=j+2)
    {
     if(PrimeNumber(j)&&PrimeNumber(m-j)) cout<<j<<' '<<m-j<<endl;

    }

    return 0;
    }


int main()
{
 int m,a,b,i,j,mult;
 scanf("%d",&m);
 a=2;
 while(a<=(m+1)/2)
 {
	 mult=1,i=2;
		 while(i<a)
		 {
			 mult=mult&&(a%i);
			 i++;
		 }
		 if(mult!=0)
		 {
			 b=m-a,mult=1,i=2;
			 while(i<b)
			 {
				 mult=mult&&(b%i);
				 i++;
			 }
			 if(mult!=0)
			 {
				 printf("%d %d\n",a,b);
			 }
		 }
	a++;
 }
}


int yes(int n)
{
    int m,i;
    m=(int)sqrt(n);
    for(i=3;i<=m;i+=2)
    {
       if(n%i==0)
       return 0;
    }
    return 1;
}
main()
{
      int m,n,i;
      scanf("%d",&n);
      for(i=3;i<=n/2;i+=2)
      {
                      if(yes(i)&&yes(n-i))
                      {

                                printf("%d %d\n",i,n-i);
                      }
      }
      getchar();
      getchar();
}


int sushu(int x)
{
	int i,j;
	if(x==3)
	return 1;
	for(i=2;i<=sqrt(x);i++)
	{
		if(x%i==0)
		{
			return 0;
		}
	}
	return 1;
}
int main()
{
	int m,i,j;
	scanf("%d",&m);
	for(i=3;i<=m/2;i=i+2)
	{
		if(sushu(i))
		{
			j=m-i;
			if(sushu(j))
			{
				printf("%d %d\n",i,j);
			}
		}
	}
	return 0;
}


int p(int n)
{
	int j,b;
	if(n<2)return 0;
	b=(int)sqrt(n);
	if(n==2) return 1;
	for(j=2;j<=b;j++)
		if(n%j==0) return 0;
	return 1;
}
int main()
{
	int m,j;
	scanf("%d",&m);
	for(j=2;j<=m/2;j+=1)
		if(p(j)&&p(m-j))printf("%d %d\n\n",j,m-j);
	return 0;
}


int main()
{
    int m, i, different, mod;
    cin >> m;
    for (i = 3; i <= m / 2; i += 2)
    {
        for (int j = 2; j <= sqrt(i); j++)
        {
            mod = i % j;
            if (mod != 0)
                continue;
            else
            {
                mod = 0;
                break;
            }
        }
            if (mod != 0 || i == 3)
            {
                different = m - i;
                for (int k = 2; k <= sqrt(different); k++)
                {
                    mod = different % k;
                    if (mod != 0)
                        continue;
                    else
                    {
                        mod = 0;
                        break;
                    }
                }
                if (mod != 0 || different == 3)
                    cout << i << " " << different << endl;
            }
            else
                continue;
    }
    return 0;
}


int main()
{
	int m, a, b;
	cin >> m;
    for (a = 3; a <= m / 2; a = a + 2)
	{
		int i;
		for (i = 3; i <= a; i = i + 2)
			if (a % i == 0)
				break;
		if (i == a)
			b = m - a;
		else
			continue;
		int k;
		for (k = 3; k <= b; k = k + 2)
			if (b % k == 0)
				break;
		if (k == b)
			cout << a << " " << b << endl;
	}
	return 0;
}


int sushu(int n)
{
	int flag=0,i;
	for(i=2;i<n;i++)
	{
		if (n%i==0)
		{
			flag=1;
			break;
		}
	}
	if(flag) return 0;
	else return 1;
}

void main()
{
	int n,m,p,i;
	scanf("%d",&n);
	m=n/2;
	for(i=2;i<=m;i++)
	{
		p=n-i;
	     if (sushu(i)==1&&sushu(p)==1)
		 {
		   printf("%d %d\n",i,p);
		 }
	}
}


int ss(int n)
{
	int i,t=0;
	scanf("%d",&n);
	for(i=2;i<=(n/2);i++)
	 {
		if(n%i==0)
		{
			t=1;
			break;
		}
	 }
	if(t==1)
	{
		return 0;
	}
	else
	{
		return n;
	}
}
int main()
{
	int m,a,b;
	scanf("%d",&m);
	for(a=3;a<=(m/2);a++)
	{
		b=m-a;
	       if(m==ss(a)+ss(b))
			{
               printf("%d %d\n",ss(a),ss(b));
			}
	}
	return 0;
}


int sushu(int n){
    int a,i;

    if (n <= 1) return(0);
    if (n == 2) return(1);
    if (n %2 == 0) return(0);

    a = sqrt( n )+1;
	for (i=3; i<=a; i+=2){
       if (n%i == 0) return(0);
    }
      return(1);
}
int main()
{
	int x,y,z;
	scanf("%d",&x);
	for(y=3;y<=x/2;y+=2){
			z=x-y;
			if(sushu(y)&&sushu(z))
				printf("%d %d\n",y,z);
		}
	return 0;
}


int sushu(int n)
{
	int i;

	for(i=2;i<=sqrt(n);i++)
	{
		if(n%i==0) return 0;

	}
	return 1;

}
int main()
{
	int m,i;
	scanf("%d",&m);
	for(i=2;i<m;i++)
	{
		if(sushu(i)&&sushu(m-i))
		{
			if(i<=m-i)
			printf("%d %d\n",i,m-i);
			else continue;
		}

	}
	return 0;
}


int main()
{
    int m, i, g, sign1, sign2;
    scanf("%d", &m);
    for (i=2;i<=m/2;i++) {
        sign1=0;
        sign2=0;
        if (i%2==0) {
            continue;
        }
        for (g=2;g<i/2;g++) {
            if (i%g!=0) {
                continue;
            } else {
                sign1=sign1+1;
            }
        }
        if (sign1==0) {
            for (g=2;g<(m-i)/2;g++) {
                if ((m-i)%g!=0) {
                    continue;
                } else {
                    sign2=sign2+1;
                }
            }
        } else {
            continue;
        }
        if (sign2==0) {
            printf("%d %d\n\n", i, m-i);
        } else {
            continue;
        }
    }
    return 0;
}


int zhishu(int x)
{
	int flag=1;
	for(int i=2;i<=x/2;i++)
	{
		if(x%i==0)
		{
			flag=0;
		}
	}
	return flag;
}
int main()
{
	int n,i;
	scanf("%d",&n);
	for(i=3;i<=n/2;i++)
	{
		if(zhishu(i)&&zhishu(n-i))
		{
			printf("%d %d\n",i,n-i);
		}
	}
	return 0;
}


int prime(int n)
{
    int i,flag=1;
    for(i=2;i<=sqrt(n);i++)
    {
        if(n%i==0)
        {
            flag=0;
            return 0;
        }
    }
    if(flag!=0)
    return 1;
}
int main()
{
    int n;
    scanf("%d",&n);
    int i,j,k;
   for(i=2;i<=n/2;i++)
   {
       if(prime(i)==1)
       {
           if(prime(n-i)==1)
           {
               printf("%d %d\n",i,n-i);
           }
       }
   }
   }


int isPrime(int x)
{
	int i;
	for(i=2;i*i<=x;i++)
		if(x%i==0)
			return 0;

	return 1;
}

int main()
{
	int m,i;
	scanf("%d",&m);

	for(i=3;i<=m/2;i+=2)
	{
		if(isPrime(i)&&isPrime(m-i))
			printf("%d %d\n",i,m-i);
	}

	return 0;
}


int main()
{
    int n;
    int a,b;
    int i,k,l;

    cin >> n;

    for(a=3;a<=n/2;a=a+2)
    {
       int j=0;
      for(i=2;i<a;i++)
      {
        if(a%i==0)
        {
         j++;
        }
        else ;
      }
      if(j>0)
      {
       continue;
       }
      else
      b=n-a;
      l=0;
      for(k=2;k<b;k++)
      {
        if(b%k==0)
        {
         l++;
        }
        else ;
      }
      if(l>0)
      {
      continue;
      }
      else
      cout << a << " " << b << endl;
      continue;
    }
    cin.get();cin.get();cin.get();
    return 0;
}


int f(int x)
{ int c=0;int i;
  for(i=1;i<=(sqrt(x)+1);i++)
  {if(x%i==0) c++  ;}
    if(c==1)
  return 1;
  else return 0;

}
int main()
{   int m;
   scanf("%d",&m);
   int c=3;
   for(;c<=m/2;c=c+2)
   {  int d;
     d=m-c;
     if(f(d)==1&&f(c)==1) printf("%d %d\n",c,d);

}
    getchar();
    getchar();
}


int sushu(int x)
{
	int i=2;
	int c=0;
	for(i=2;i<=x;i++)
	{
		if(x%i==0)
			break;
		if(2*i>x)
			c=1;
		}
    return c;
}

void main()
{
	int a;
	int j;
	scanf("%d",&a);
	for(j=1;4*j+2<=a;j++)
	{
		if(!sushu(2*j+1))
			continue;
		else
			if(sushu(a-1-2*j))
			    printf("%d %d\n",2*j+1,a-1-2*j);
	}
}


main()
{
	int m,i,j,k,l;
	scanf("%d",&m);
	for(i=3;i<=m/2;i++,i++)
	{
		for(k=2;k<i;k++)
		{
			if(i%k==0)break;
		}
		if(k<i)continue;
		else
		{
			j=m-i;
			for(l=2;l<j;l++)
			{
				if(j%l==0)break;
			}
			if(l>=j)printf("%d %d\n",i,j);
		}
	}
}


int prime(int p);
void main()
{
	int a,i;
	scanf("%d",&a);
	for (i=2;i<=a/2;i++)
	{
		if (prime(i)&&prime(a-i)) printf("%d %d\n",i,a-i);
	}
}
int prime(int p)
{
    int i;
	for (i=2;i<=(int)sqrt(p);i++)
	{
		if (p%i==0) return(0);
	}
	return(1);
}


int number(int n)
{
    int i;
    for(i=2;i<n;i++)
    if(n%i==0)
    return 0;
    return 1;
}
int main()
{
    int m,i;
    scanf("%d", &m);
    for(i=3;i<m;i=i+2)
    {
    if(number(i)&&number(m-i))
    {
                              if(i<=m-i)
                              printf("%d %d\n", i, m-i);

    }
    }

    return 0;
}


int main ()
{
	int m;
	int tmp=0;
	cin>>m;
	for(int i = 3 ; i <= m/2 ; i++)
	{
		int count1=0;
		int count2=0;
		for(int k = 2 ; k < i ; k++)
		{
			if(i%k!=0)count1++;
		}
		if(count1<i-2)continue;
		for(int j = 2 ; j < m-i ; j++)
		{
			if((m-i)%j!=0)count2++;
		}
		if(count2==m-i-2)
		{
			tmp++;
			if(tmp==1)cout<<i<<" "<<m-i;
			else cout<<'\n'<<i<<" "<<m-i;
		}
	}
	return 0;
}


int sushu(int a)
{
int i;
   for(i=2;i<a;i++)
   {
      if(a%i==0)
      break;
    }
    if(i==a)
      return 1;
}
main()
{
      int m,i;
      scanf("%d",&m);
      for(i=3;i<=m/2;i=i+2)
      {
         if((sushu(i)==1)&&(sushu(m-i)==1))
           printf("%d %d\n",i,m-i);
      }
}


int main()
{
	int a[N],m,i,j,test,number=0;
	for(i=3;i<=N;i++)
	{
		test=1;
		for(j=2;j<i;j++)
		{
			if(i%j==0) test=0;
		}
		if(test)
		{
			number=number+1;
			a[number-1]=i;
		}
	}
	scanf("%d",&m);
	for(i=0;i<number;i++)
	{
		for(j=i;j<number;j++)
		{
			if(a[i]+a[j]==m)
			{
				printf("%d %d\n",a[i],a[j]);
			}
		}
	}
	return 0;
}


int main()
{
	int k,m,i,n,flag1=0,flag2=0,j;
	scanf("%d",&n);
	for(i=3;i<n;i++)
	{
		flag1=flag2=0;
		for(m=2;m<i;m++){if(i%m!=0)flag1++;}
		if(flag1!=i-2)continue;
		j=n-i;
		for(k=2;k<j;k++){if(j%k!=0)flag2++;}
		if(flag2!=j-2)continue;
		if(i<=j)printf("%d %d\n\n",i,j);
	}
	return 0;
}


int panduan(int n)
{
	int i,a,k=1;
	a=n/2+1;
	for(i=2;i<a;i++)
	{
		if(n%i==0) k=0;
	}
	return k;
}

void main()
{
	int i,m;
	scanf("%d",&m);
	i=3;
	while (i<m/2+1)
	{
		if (panduan(i)==1&&panduan(m-i)==1) printf("%d %d\n",i,m-i);
		i+=2;
	}
}


int main()
{
	int m,i,j,flag,t;
	scanf("%d",&m);
	for(i=3;i<=m/2;i++)
	{
		flag=1;
		for(j=2;j<i;j++)
		{
			if(i%j!=0)
				flag*=1;
			else
				flag*=0;
		}
		if(flag==1)
		{
			t=m-i;
			flag=1;
			for(j=2;j<m-i;j++)
			{
				if((m-i)%j!=0)
					flag*=1;
				else
					flag*=0;
			}
			if(flag==1)
				printf("%d %d\n",i,m-i);
		}
	}
	return 0;
}


int main()
{
	int i,j,n,flag,k=0;
	int zhishu[10000];
	scanf("%d",&n);
	for(i=3;i<n;i=i+2)
	{
		flag=0;
		for(j=3;j<sqrt(i)+1;j=j+2)
		{
			if(i%j==0)
			{
				flag=1;
				break;
			}
		}
		if(flag==0)
		{
			zhishu[k]=i;
			k++;
		}
	}
	for(i=0;i<=k;i++)
	{
		for(j=k-1;j>=i;j--)
		{
			if(n-zhishu[i]==zhishu[j])
				printf("%d %d\n",zhishu[i],zhishu[j]);
		}
	}
	return 0;
}


int zhi(int x)
{
    int b=1,i=1;
    for(i=2;i<=x/2;i++)
    if(x%i==0) b=b+1;
    return b;
}
int main()
{
    int i,m;
    cin>>m;
    for(i=3;i<=m/2;i=i+2)
    {
                         if(zhi(i)==1&&zhi(m-i)==1)
                         cout<<i<<' '<<m-i<<endl;
    }

    return 0;
}


int main()
{
    int number,i,j,f,g,s;
    int k=1;
    scanf("%d",&number);
    int num[20000];
    for(i=2;i<number;i++)
    {  s=i-1;
    for(j=(i-1);j>0;j--)
    {
    if(i%j!=0)
    s--;}
   if(s==1)
   {num[k]=i;
    k++;}}
   for(f=k-1;f>0;f--)
 {
                  for(g=1;g<=f;g++)
                  {if(num[f]+num[g]==number)
                  printf("%d %d\n",num[g],num[f]);}}
  getchar();
  getchar();
  return 0;
}


int IsPrime(int a)
{
	int i,flag=0;
	for (i = 2; i <a/2; i++)
	{
		if (a%i == 0){ flag = 1; continue; }
	}
	if (flag == 0)return 1;
	else return 0;
}
int main()
{
	int b,i;
	long m;
	scanf("%ld", &m);
	for (b = 3; b <= m /2;b+=2)
	   if (IsPrime(m-b) == 1 && IsPrime(b) == 1)
		   printf("%d %d\n",b,m-b);
	return 0;
}


int ss(int a);

main()
{
      int m;
      scanf("%d",&m);
      int a,b;
      int i,j;
      for(a=3;a<=m/2;a++)
      {
          i=ss(a);
          if(i==0)
          {
              b=m-a;
              j=ss(b);
              if(j==0)
              printf("%d %d\n",a,b);
          }
      }
      return 0;
}

int ss(int a)
{
      int i=2,k=0;
      for(i=2;i<=(a/2);i++)
          if((a%i)==0)
              k++;
      return k;
}


//??????

int main()
{
    int n, a, b, sureA = 0, sureB = 0;
    cin>>n;
    for(a = 3 ; a <= n/2 ; a += 2)
    {
        b = n - a;
        if(a == 3)
            sureA = 1;
        if(b == 3)
            sureB = 1;
        for(int i1 = 2 ; i1 <= sqrt(a) ; i1++)
        {
            if(a % i1 == 0)
                break;
            if(sqrt(a) - i1 < 1)
                sureA = 1;
        }
        for(int i2 = 2 ; i2 <= sqrt(b) ; i2++)
        {
            if(b % i2 == 0)
                break;
            if(sqrt(b) - i2 < 1)
                sureB = 1;
        }
        if(sureA == 1 && sureB == 1)
            cout<<a<<" "<<b<<endl;
        sureA = 0;
        sureB = 0;
    }

    return 0;
}


int main ()
{
	int m,a,i;
	int sushu(int m);
	int jishu(int m);
	scanf("%d",&m);
	for(i=1;i<=(m/2);i++)
	{
		if(sushu(i)&&jishu(i))
		{
			a=m-i;
			if(sushu(a)&&jishu(a))
				printf("%d %d\n",i,a);
		}
	}
	return 0;
}
int sushu(int m)
{
	int t,c,k;
	k=sqrt(m);
	for(t=2;t<=k;t++)
		if(m%t==0)break;
		if(t>k) c=1;
		else c=0;
		if(m<3)
			c=0;
		return(c);
}
int jishu(int m)
{
    int d;
    if(m%2==0)
		d=0;
	else
		d=1;
	return(d);
}


int main()
{
int m,a,b,i;
scanf("%d",&m);
if((m%2)==0)
{
for(a=3;a<=m/2;a+=2)
{
for(i=2;i<a;i++)
{
if(a%i==0)break;}
if(i<a)
continue;
else
{
b=m-a;
for(i=2;i<b;i++)
{
if(b%i==0)break;}
if(i<b)
continue;
else
printf("%d %d\n",a,b);
}
}
}
return 0;
}


int su(int x);

int main(){
	int m,n,i;
	scanf("%d",&m);
	for(i=3;i<=m/2;i++)
	{
		if(su(i)==1&&su(m-i)==1)
			printf("%d %d\n",i,m-i);
	}
	return 0;
}

int su(int x){
	int j;
	for(j=2;j<=x/2;j++)
	{
		if(x%j==0)
			return 0;
	}
	return 1;
}


int f(int n)
{
    int m=0;
    int i=2;
    for(;i<n;)
    {
    if(n%i==0)
    break;
    i++;
    }
    {
    if(i==n)
    m=1;
    }
    return m;
}
main()
{
    int n,k;

    scanf("%d",&n);
    for (int i=3;i<=(n/2);i++)
    {   k=n-i;
        {if (f(i)==1&&f(k)==1)
        printf("%d %d\n",i,k);
        }
    }
    getchar();
    getchar();
    return 0;
}


int main(){
	int n,i,j;
	int k;
	cin>>n;
	for(i=3;i<=n/2;i+=2){
		//cout<<i<<" "<<j<<endl;
		j = n-i;
		int flag;
		for(k=2;k<i;k++)
		{
			if(i%k!=0)
				flag=0;
			if(i%k==0){
				flag=1;
				break;
			}
		}
		if(flag == 1)continue;
		for(k=2;k<j;k++)
		{
			if(j%k!=0)
				flag=0;
			if(j%k==0){
				flag=1;
				break;
			}
		}
		if(flag == 0)
			cout<<i<<" "<<j<<endl;

	}
	return 0;
}


int sushu(int x)
{
	int i,k;
	k=sqrt(x);
	for(i=2;i<=k;i++){
		if(x%i==0)break;}
	if(i>k) return 1;
	else return 0;
}
int main()
{
	int m,i,a,b;
	scanf("%d",&m);
	for(i=1;i<(m+2)/4;i++){
		a=2*i+1;
		b=m-a;
		if(sushu(a)==1){
			if(sushu(b)==1)printf("%d %d\n",a,b);}
	}
	return 0;
}


int isprime(int p);
int main(){
	int m,a,b,prime1,prime2;
	scanf("%d",&m);
	for(a=3;a<=m/2;a=a+2){
		b=m-a;
		prime1=isprime(a);
		prime2=isprime(b);
		if(prime1&&prime2)
			printf("%d %d\n",a,b);

	}

	return 0;
}

int isprime(int p){
	int i,isprime=1;
	if(p%2==0){
		if(p==2){
		return isprime;
	}
	isprime=0;
	return isprime;
	}

	for(i=3;i<p;i=i+2){
		if(p%i==0){
		isprime=0;
		break;
		}
	}
	return isprime;

}


int main()
{
    int n,i,j;
    scanf("%d",&n);
    int f(int);
    int (*p)(int);
    p=f;
    for(i=3;i<n/2+1;i=i+2)
    {
      if((*p)(i)==1&&(*p)(n-i)==1)
       printf("%d %d\n",i,n-i);
     }
     getchar();
     getchar();
 }
 int f(int a)
{
    int i,c;
    for(i=2;i<a;i++)
     if(a%i==0)break;
     if(i==a)//???
     c=1;
     else c=2;
     return(c);
}


int sushu(int x)
{
	int j;
	for(j=2;j<x;j++)
	{
		if(x%j==0) break;
	}
	if(j==x) return 1;
	else return 0;
}

int main()
{
	int m,a,b;
	int i,j;
	scanf("%d",&m);
	for(i=3;i<=m-i;i++)
	{
		a=sushu(i);
		b=sushu(m-i);
		if(a==1&&b==1) printf("%d %d\n",i,m-i);
	}

    return 0;
}


int main()
{
	int n,i;
	scanf("%d",&n);
	for (i=3;i<=(n/2);i=i+2)
		if (check(i)&&check(n-i))
			printf("%d %d\n",i,n-i);
}

int check(int a)
{
	int i;
	for (i=2;i<=sqrt(a);i++)
		if (a%i==0) return 0;
	return 1;
}


int fun(int x);
int main()
{
    int a,i;
    scanf("%d",&a);
    for(i=3;i<=a/2;i+=2)
    {
                      if(fun(i)==1&&fun(a-i)==1)
                      printf("%d %d\n",i,a-i);
                      }
    return 0;
}
int fun(int x)
{
    int i;
	for(i = 2; i <= (int)sqrt(x); i++)
		if(x % i == 0)
			return 0;
	return 1;
}


int sushu(int a)
{
 int i;
 for(i = 2;i <= sqrt(a)+1;i ++)
 {if(a%i == 0) {a = 1; break;}}
 return a;
}
int main()
{
  int n,s1,s2,j,k;
  scanf("%d",&n);
  for(j = 2;j <= n/2; j++){
  s1=sushu(j);
  if(s1 != 1){
    k=n-s1;
    s2=sushu(k);
	if(s2 != 1)
	printf("%d %d\n",s1,s2);
  }
 }
 return 0;
}


int checkprime(int x)
{
	int j;
    int count=0;
    if (x==1) count=1;
    if (x==2||x==3) count=0;
   if (x>=4){
	for (j=2;j<=sqrt(x);j++)
	{
		if (x%j==0)
			count++;

	}}
	return count;

}
int main()
{
	int i;
	int n;
	cin>>n;
	for (i=1;i<=n/2;i++)
	{
		if (checkprime(i)==0&&checkprime(n-i)==0)
			cout<<i<<" "<<n-i<<endl;
	}
	return 0;
}


int prime(int n)
{
    int i,isprime=1;
    for(i=2;i*i<=n;i++)
    {
        if(n%i==0)
           {
            isprime=0;
            break;
           }
    }
    return isprime;
}
main()
{
    int n,i,a,b;
    scanf("%d",&n);
    for(i=3;i<=n/2;i+=2)
    {
        a=prime(i);
        b=prime(n-i);
        if(a==1&&b==1)
            printf("%d %d\n",i,n-i);
    }
    getchar();
    getchar();
}


int pd(int x)
  {
    int z=0,i;
    if(x%2!=0)
       {for(i=3;i<=sqrt(x);i+=2)
           {if(x%i==0)
            break;
           }
         if(i>sqrt(x))
         z=1;}
         return z;
    }

int main()
{
    int n,a;
    scanf("%d",&n);
    for(a=3;a<=n/2;a+=2)
      {
        if(pd(a)==1&&pd(n-a)==1)
          printf("%d %d\n\n",a,n-a);
      }

     return 0;
}


int sushu(int x){
if(x==1) return 0;
if(x==2||x==3) return 1;
int m=sqrt(x);
int i;
for(i=2;i<=m;i++){
if(x%i==0) return 0;
}
if(i==m+1) return 1;
}

int main(int argc, char* argv[])
{
int m;
scanf("%d",&m);

int i;
for(i=3;i<=m/2;i+=2){
if(sushu(i)&&sushu(m-i)) printf("%d %d\n",i,m-i);}
	return 0;
}


int i,j,n;
int prime(int a)
{
	for(i=2;i*i<=a;i++)
		if(a%i==0) return(0);
}
int main()
{
	cin>>n;
	for(j=2;j<=n/2;j++)
	{
		if(prime(j)*prime(n-j)!=0) cout<<j<<" "<<n-j<<endl;
	}
    return 0;
}


int main()
{
    int m,a,b,i;
    scanf("%d",&m);
	for(a=3;a<=m/2;a+=2)
	{
		for(i=3;i<=a;i+=2)
			if(a%i==0)break;
		if(i<a)continue;
		else
		{
			b=m-a;
			for(i=3;i<=b;i+=2)
				if(b%i==0)break;
			if(i==b)
				printf("%d %d\n",a,b);
		}
	}
	return 0;
}


void main()
{
	int su(int m);
	int n,i;

	scanf("%d",&n);
	for(i=3;i<=n/2;i++)
	{
		if(su(i)&&su(n-i))
		{
			printf("%d %d\n",i,n-i);
		}
	}
}

int su(int m)
{
	int j;
	for(j=2;j<=sqrt(m);j++)
		if(m%j==0)break;

	if(j>sqrt(m))
		return 1;
	else
		return 0;
}


int main()
{

	int judge(int x);
		int n,i,j,d=0;
	scanf("%d",&n);
	for(i=3;i<=n/2;i++)
	{d=0;
		if(judge(i)==1)d=d+1;
        j=n-i;
        if(judge(j)==1)d=d+1;
		if(d==2)printf("%d %d\n",i,j);

	}

	return 0;
}
int judge(int x)
{
	int i;
	for(i=2;i<=x/2;i++)
		if(x%i==0) break;
	if(i>x/2) return 1;
	else return 0;
}


int main()
{
    int m,i,o,k,l;
    cin>>m;
    for(i=2;i<=(m/2);i++)
    {
       o=m-i;
       for(k=2;k<i;k++)
       {
          if (i%k==0) goto end;
          }
       for(l=2;l<o;l++)
       {
          if (o%l==0) goto end;
          }
       cout<<i<<" "<<o<<endl;
       end: continue;
       }
       return 0;
}


int main()
{
    int m;
    cin >> m;
    int n1, n2, i, j, p1, p2;
    double a, b;
    for(n1 = 3; n1 <= m / 2; n1 += 2)
    {
        n2 = m - n1;
        a = sqrt(n1);
        b = sqrt(n2);
		//cout << a << b <<endl;
        for(i = 2; i <= a; i++)
        {
            if(n1 % i == 0)
				break;
        }
        if(i > a )
        {
            p1 = n1;
        }
        else
        {
            continue;
        }
        for(j = 2; j <= b; j++)
        {
            if(n2 % j == 0)
				break;
        }
		if(j > b )
		{
			p2 = n2;
		}
		else
		{
			continue;
		}
		cout << p1 << " " << p2 << endl;
    }
    return 0;
}


int prime(int a);
int main()
{
	int i=3,m,d;
	cin>>m;
	for(i=3;i<=m/2;i+=2)
	{
		if(prime(i)!=0)
		{
			d=m-i;
			if(prime(d)!=0)
			{
				cout<<i<<" "<<d<<endl;
			}
		}
	}
	return 0;
}

int prime(int a)
{
	int e=1,i=3;
	if(a<7)
		a+=8;
	else
		if(a==7)
			return 1;
	for(i=3;i<=sqrt(a*1.0);i+=2)
	{
		e*=a%i;
		if(e!=0)
			e=1;
	}
	if(e!=0)
		return 1;
	else
		return 0;
}


int main()
{
 int prime(int );
 int m;
 scanf("%d",&m);
 int a,b;
 for(a=3;a<=m/2;a=a+2)
 {
  if(prime(a))
  {
   b=m-a;
   if(prime(b))
    printf("%d %d\n",a,b);
  }
 }

 return 0;
}

int prime(int n)
{
 int i,k=sqrt(n);
 for(i=2;i<=k;i++)
 {
  if(n%i==0) break;
 }
 if(i>k) return 1;
 else return 0;
}


int main()
{
	int m,a=2,b,i=2,j=2;
    scanf("%d",&m);
	while(a<=m/2)
	{
		int i=2,j=2;
		while(i<a)
		{
		  if(a%i!=0)
		  i++;
		  else
		  goto loop1;
        }
	  b=m-a;
	  while(j<b)
 		{
		  if(b%j!=0)
		  j++;

		  else
		  break;

		  if(j==b)
          {
          printf("%d %d\n",a,b);
		  break;
          }
        }
		loop1:a++;
    }

}


int main()
{
	int n,i,j,k,a;
	double b;
		scanf("%d",&n);
	for(i=3;i<=2*n-1;i=i+2)
	{
		b=i;
		a=(int)sqrt(b)+1;
		for(k=2;k<a;k++)
		{
			if(i%k==0)
				break;
		}
		if(a==k)
			for(j=i;j<=n-i;j=j+2)
			{
				b=j;
				a=(int)sqrt(b)+1;
				for(k=2;k<a;k++)
				{
					if(j%k==0)
						break;
				}
				if(a==k)
					if(n==i+j)
						printf("%d %d\n",i,j);
			}
	}

	return 0;
}


int main()
{
	int zhishu(int x);
	int m,i,k,n,p;
	scanf("%d",&m);
	for(i=2;i<=m/2;i++)
	{
		n=m-i;
		k=zhishu(i);
		p=zhishu(n);
		if(p==1&&k==1)
			printf("%d %d\n",i,n);
	}
	return 0;
}
int zhishu(int x)
{
	int i,j,k;
	if(x==2)
		k=1;
	else
		for(i=2;i<x;i++)
		{
			j=x%i;
			if(j==0)
				{
					k=0;
				    break;
			}
			else
				if(i==x-1)
					k=1;
		}
		return k;
}


int main()
{
    int oushu,xiao,da,i,j,panduan;
    cin>>oushu;
    for(xiao=3;xiao<=oushu/2;xiao++)
    {
                                         panduan=0;
                                         da=oushu-xiao;
                                         for(i=2;i<xiao;i++)
                                         {
                                                                     if(xiao%i==0)panduan++;//??????????? ??????panduan??
                                         }
                                         for(j=2;j<da;j++)
                                         {
                                                                   if(da%j==0)panduan++;//?????????????????panduan??
                                         }
                                         if(panduan==0)cout<<xiao<<" "<<da<<endl;//???????????panduan?????????

    }
cin.get();cin.get();cin.get();
return 0;
}


int main()
{
	int n;
	cin>>n;
	int a,b,c,d;
	for(a=3;a<=n/2;a=a+2)
	{
		for(c=2;c<=sqrt((double) a);c++) if(a%c==0) break;
		for(d=2;d<=sqrt((double)n-a);d++) if((n-a)%d==0) break;
		if(c>sqrt((double)a)&&d>sqrt((double)n-a)) cout<<a<<" "<<n-a<<endl;
	}
	return 0;
}


int main()
{
   int m,a,b,i;
   scanf("%d",&m);
   for(a=2;a<=(m/2);a++)
   {
       b=m-a;
       for(i=2;i<a;i++)
       {if(a%i!=0)
       continue;
       else
       goto a;}
       for(i=2;i<b;i++)
       {
           if(b%i!=0)
           continue;
           else
           goto a;
       }
    printf("%d %d\n",a,b);
    a:continue;
   }
   return 0;
}


int zhiyinshu(int x)
{
	int i=2;
	while (i<x)
	{
		if (x%i==0)
		{
			return 0;
		}
		else
		{
			i++;
		}
	}
	return 1;
}
int main ()
{
    int i,j,x;
    scanf("%d",&x);
    for (i=3;i<j;i++)
    {
        j=x-i;
        if ((zhiyinshu(i)==1)&&(zhiyinshu(j))) printf("%d %d\n",i,j);
    }
    return 0;
}


int main()
{
    int jishu(int x);
    int sushu(int x);
    int m,a,i;
    scanf("%d",&m);
    for(i=1; i<=(m/2); i++)
    {
        if(sushu(i)&&jishu(i))
        {
            a=m-i;
            if(jishu(a)&&sushu(a))
            {
                printf("%d %d\n",i,a);
            }
        }
    }

    return 0;
}
int jishu(int x)
{
    int d;
    if(x%2==0)
        return 0;
    else
        return 1;
}
int sushu(int x)
{
    int k,i,c;
    k=sqrt(x);
    if(x<3)
    {
        return 0;
    }
    else
    {
        for(i=2; i<=k; i++)
        {
            if(x%i==0)
            {
                break;
            }
        }
        if(i>k)
        {
            return 1;
        }

        else
        {
            return 0;
        }
    }

}


int shisushu(int n);
int main(){
	int m,n;
	scanf("%d",&m);
	for(n=2;n<=m/2;n++){
		if(shisushu(n)==1){
			if(shisushu(m-n)==1){
				printf("%d %d\n",n,m-n);
			}
		}
	}
	return 0;
}
int shisushu(int n){
	int i;
	int result=1;
	for(i=2;i<=n/2;i++){
		if(n%i==0){
			result=0;
			break;
		}
	}
	return result;
}


int main(){
	int m,i,j,t,k;
	scanf("%d",&m);
	for(i=3;i<=m/2;i=i+2){
		for(j=3;j<i;j=j+2)
			if(i%j==0)
				break;
		if(j<i)
			continue;
		else{
			t=m-i;
			for(k=3;k<t;k=k+2)
				if(t%k==0)
					break;
			if(k==t)
				printf("%d %d\n",i,t);
		}
	}
	return 0;
}


int JudgePrime(int n);
int JudgeOdd(int n);
void f(int n);
int main()
{
   int num;
   cin>>num;
   f(num);
   return 0;
}
void f(int n)
{
   int i;
   for(i=2;i<=n/2;i++)
   {
      if(JudgePrime(i)==1
      && JudgeOdd(i)==1
      && JudgePrime(n-i)==1
      && JudgeOdd(n-i)==1)
      cout<<i<<' '<<n-i<<endl;
   }
}
int JudgePrime(int n)
{
   int k,i;
   k=sqrt(n);
   if(n==2) return 1;
   else
   {
      for(i=2;i<=k;i++)
      {
          if(n%i==0) return 0;
      }
   }
   return 1;
}
int JudgeOdd(int n)
{
   if(n%2==1) return 1;
   else return 0;
}


int main()
{
	int m, i, j, n, sqrti, sqrtn;
	scanf("%d",&m);
	if(m>=6 && m<=10000 && m%2==0)
	{
		for(i=3; i<=m/2; i+=2)
		{
			sqrti=(int)sqrt(i);
			for(j=3; j<=sqrti; j+=2)
			{
				if(i%j==0)
					break;
			}
			if(j>sqrti)
			{
				n=m-i;
				sqrtn=(int)sqrt(n);
				for(j=3; j<=sqrtn; j+=2)
				{
					if(n%j==0)
						break;
				}
				if(j>sqrtn)
					printf("%d %d\n",i,n);
			}
		}
	}
	return 0;
}


int main ()
{
	int m,a,b,i;
	scanf("%d",&m);
	for (a=3;a<=m/2;a+=2)
	{
		for(i=2;i<=sqrt(a);i++)
			if (a%i==0) break;
		if (i>sqrt(a))
			b=m-a;
		else
			continue;

		for(i=2;i<=sqrt(b);i++)

			if (b%i==0)break;
		if (i>sqrt(b))
			printf("%d %d\n",a,b);

	}
	return 0;
}


int prime(int k);

int main()
{
    int n;
    cin>>n;

    for (int i=2;i<=n/2;i++)
       if (prime(i)&&prime(n-i)) cout<<i<<' '<<n-i<<endl;

}

int prime(int k)
{
    if (k==2) return 1;
    for (int i=2;i<=k/2;i++)
    if (k%i==0) return 0;
    return 1;
}


void main()
{
	int m,a,b,c,d;
	scanf("%d",&m);
	for(a=3;a<m;a++)
	{
		for(c=2;c<=sqrt(a);c++)
				if(a%c==0)
					break;
				if(c>sqrt(a))
				{
					b=m-a;
					for(d=2;d<=sqrt(b);d++)
					{
						if(b%d==0)
							break;
					}
					if(d>sqrt(b)&&a<=b)
						printf("%d %d\n",a,b);
				}
				}
}


int work(int n)
{
	for(int i=3;i<=sqrt(n);i+=2)
	if(n%i==0)return 0;
	return 1;
}
int main()
{
	int m,i;
	cin>>m;
	for(i=3;i<=m/2;i+=2)
	{
		if(work(i)&&work(m-i))
		cout<<i<<' '<<m-i<<endl;
	}
	return 0;
}


void main()
{
	void pro(int n);
	int n;
	scanf("%d\n",&n);
	pro(n);
}
void pro(int n)
{
	int *odd(int n),*head;
	int i,j;
	head=odd(n);
	for(i=0;head[i]<=n/2;i++)
		for(j=i;head[j]!=0;j++)
		{
			if(head[i]+head[j]==n)printf("%d %d\n",head[i],head[j]);
		}
}
int *odd(int n)
{
	int i,j,k,m=0;
	int a[1000]={0};
	for(i=3;i<n;i+=2)
	{
		k=sqrt(i);
		for(j=2;j<=k;j++)
		{	if(i%j==0)break;}
		if(j>k)
		{
			a[m]=i;m++;
		}
	}
	return(a);
}


int prime(int n)
{
    int i,z=1;
    for(i=3;i<=n/2;i++)
    {
         if(n%i==0)
         {z=0;break;}
    }
    return z;
}
main()
{
      int n,i;
      scanf("%d",&n);
      for(i=3;i<=n/2;i=i+2)
      {
           if(prime(i)==1&&prime(n-i)==1)
           printf("%d %d\n",i,n-i);
      }
      getchar();
      getchar();
      return 0;
}


int sushu(int x)
{
	int a,b,t=2;
	b=sqrt(x);
	for (int i=2;i<=b;i++)
	{
		if (x%i==0)
		{
			t=i;
			break;
		}
		else {t=i+1;}
	}
	if (t>b)
		a=1;
	else a=0;
	return (a);
}
int main()
{
	int n,c;
	cin>>n;
	for (int j=3;j<=(n/2);j++)
	{
		c=n-j;
		if (sushu(c)+sushu(j)==2)
			cout<<j<<" "<<c<<endl;
	}
	return 0;
}


int prime(int n)
{
int i;
double k=sqrt((double)n);
for(i=2;i<=k;i++)
if(n%i==0) break;
if(i>k) return 1;
else return 0;
}
int main()
{
int m;
scanf("%d",&m);
int i;
for(i=3;i<=m/2;i+=2)
if(prime(i)&&prime(m-i)) {printf("%d %d\n",i,m-i);continue;}
return 0;
}


//?????
int f(int a)
{
	int i;
	int l=(float)sqrt((float)a);
	for(i=2;i<=l;i++)
		if(a%i==0)
		{
			break;
			return 0;
		}
	if(i==l+1)
		return 1;
}
int main()
{
	int n,i;
	scanf("%d",&n);
	if (n%2!=0)
		return 0;
	else
	{
		for(i=3;i<=n/2;i=i+2)
			if(f(i)==1&&f(n-i)==1)
				printf("%d %d\n",i,n-i);
	}
	return 0;
}