semeru/Code-Code-CloneDetection-POJ104 huggingface dataset:
//***************************************************
//1.cpp ??????     ******
//?? ???  1200018209  ********
//?? 2012-10-15 ******
//***************************************************
int main()
{
	int temp,n,i,j,a[10000],k=1;
	a[0]=2;
	cin >> n;
	for(i=3;i<=n;i=i+2)
	{
		temp=sqrt(i);
		for(j=2;j<=temp;j++)
		{
			if(i%j==0)break;
		}
		if(j==temp+1)
		{
			a[k]=i;
			k++;
		}
	}
	for(i=0;i<k;i++)
	{
		for(j=k-1;j>=i;j--)
		{
			if(a[i]+a[j]==n)
			{
				cout << a[i] << " " << a[j] << endl;
			}
		}
	}
	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, j, p, q;
	cin >> m;
	if (m == 6)
	{
		cout << 3 << " " << 3 << endl;
	}
	if (m == 8)
	{
		cout << 3 << " " << 5 << endl;
	}
	if (m == 10)
	{
		cout << 3 << " " << 7 << '\n' << 5 << " " << 5 << endl;
	}
	if (m == 12)
	{
		cout << 5 << " " << 7 << endl;
	}
	if (m >= 14)
	{
		for (i = 3; i <= m / 2; i = i + 2)
		{
			if ((i == 3) || (i == 5) || (i == 7))
			{
				j = m - i;
				for (q = 3; q <= sqrt(j); q = q + 2)
				{
					if (j % q == 0)
					{
						break;
					}
					else if ((j % q != 0) && (q <= sqrt(j)) && (q + 2 > sqrt(j)))
					{
						cout << i << " " << j << endl;
					}
				}
			}
			for (p = 3; p <= sqrt(i); p = p + 2)
			{
				if (i % p == 0)
				{
					break;
				}
				else if ((i % p != 0) && (p <= sqrt(i)) && (p + 2 > sqrt(i)))
				{
					j = m - i;
					for (q = 3; q <= sqrt(j); q = q + 2)
					{
						if (j % q == 0)
						{
							break;
						}
						else if ((j % q != 0) && (q <= sqrt(j)) && (q + 2 > sqrt(j)))
						{
							cout << i << " " << j << endl;
						}
					}
				}
			}
		}
	}
	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;
  scanf("%d",&m);
  int a,i;
  for(a=3;a<=(m/2);a=a+2)
  {
      int c=0;
      for(i=2;i<a;i++)
      if(a%i==0)
      c++; 
      int d=0;
      for(i=2;i<m-a;i++)
      if((m-a)%i==0)
      d++; 
     
     
     if(c==0&&d==0)
    printf("%d %d\n",a,m-a);  
  }
  getchar();
  getchar(); 
}
/*
 * 16.cpp
 *??????
 *  Created on: 2012-10-18
 *      Author: ???
*/
int main()
{
	int m;
	cin>>m;
	for(int i1=3;i1<=m/2;i1=i1+2)
	{

	int t=1,p=1;
		for(int k1=2;k1<=sqrt(i1);k1++)
		{
			int q1=i1%k1;
			t=t*(q1!=0);
		}//????????????
		if(t==1)
		{
			int i2=m-i1;
			for(int k2=2;k2<=sqrt(i2);k2++)
					{
						int q2=i2%k2;
						p=p*(q2!=0);
					}//??????????
			if(p==1)
				cout<<i1<<" "<<i2<<endl;
		}

	}
		}
int main()
{
	int m,n,i,j,b,a[5000];
	scanf("%d",&m);
	n=b=0;
	for(j=3;j<m;j++)
	{
		for(i=2;i<=j/2;i++)
		{
			if(j%i==0)
			{
				n=1;
				break;
			}
		}
		if(n==0)
		{
			a[b]=j;
			b+=1;
		}
		else
		{
			n=0;
		}
	}
	for(i=0;i<=b;i++)
	{
		for(j=i;j<=b;j++)
		{
			if(m==a[i]+a[j])
			{
				printf("%d %d\n",a[i],a[j]);
			}
		}
	}
	return 0;
}
int issn(int n);
int main()
{
	
int n,a,b=0,c;
	
int z[10000];
	
scanf("%d",&n);
	

    for(a=3;a<n+100;a++)
	
{
	
	
if(issn(a))
	
	
{
	
	
	
z[b]=a;
	
	
	
b++;
	
	
}
	
}
	

	
for(a=0;a<=b-1;a++)
	
{
	
	
for(c=a;c<b-1;c++)
	
	
{
	
	
	
if(z[a]+z[c]==n)
	
	
	
{
	
	
	
	
printf("%d %d\n",z[a],z[c]);
	
	
	
}
	
	
}
	
}
	

	
return 0;
}

int issn(int n)
{
    int a,b=1;
	
for(a=2;a<n;a++)
	
{
	
	
if(n%a==0) b=0;
	
}
    return b;
}
//********************************
//*???????????   **
//*????? 1200012845 **
//*???2012.10.22  **
//********************************
int main()
{
	int m, a, b, i, j;  //j?a????i?b???
	cin >> m;
	for (a = 3; a <= (m / 2); a = a + 2)
	{
		
		int a1 = (int) sqrt(a);
		for (j = 2; j <= a1; j++)
		{
			if (a % j == 0) break;  //?a??j??????????????
		}
		if (j == (a1 + 1))                 //?j=a1+1?a???j???????a???
		{
			for (b = a; b <= m; b = b + 2)
			{			
				int b1 = (int) sqrt(b);
				for (i = 2; i <= b1; i++)
				{
					if (b % i == 0) break;  //?b??i??????????????
				}
				if ((i == (b1 + 1)) && (a + b == m))    //?i=b1+1?b???i???????b???            
				{
					cout << a << " " << b << endl;
				}
			}
		}
	}
	return 0;
}
//********************************
//*?????????           **
//*?????? 1200012808      **
//*???2012.10.10             **
//********************************

// ?????????????????????int f(int x) 
int f(int x)
{
	int j;
	for (j = 2; j <= sqrt((double)x); j++)
	{
	    if (x % j == 0)
			return false;
	}
	return true;
}

int main()
{
	int m, x, y;
	cin >> m;
	for ( x = 3; x <= m / 2 ; x += 2) // ?????m??????
	{
		y = m - x;
		if ((f(x) == true) && (f(y) == true)) // ??x?m-x?????
			cout << x << " " << y << endl; // ?????
	}
	return 0;
}
//*************************************
//*???Oct 23, 2013 - ?????? **
//*?????? 1300012719           **
//*???2013.10.25                  **
//*************************************
int main()
{
	int m, p1, p2, i, k;                           //m?????6???,p1,p2?????????????,i???p1,p2??????????,k???????????
	cin >> m;
	for (p1 = 3; p1 <= (m / 2); p1 += 2)           //??????m,??m>=6,????????2,p1??3???????????
	{
		k = 1;                                     //?????k
		for (i = 1; i <= sqrt (p1); i += 2)        //??p1????2???,???i????p1,?i?1?p1^(1/2)??????
		{
			if ((p1 % i == 0) && (i != 1))         //?????????1?i?p1???,??k???,???????,?????k=0
			{                                      //??,?????????1?i???p1????p1???,?????k=1
				k = 0;
				break;
			}
		}
		if (k == 1)                                //??p1?????,????,??????,p1????
		{
			p2 = m - p1;                           //?p1???,???p2?????
			for (i = 1; i <= sqrt (p2); i += 2)    //??????,??i???,???????k??1???????
			{
				if ((p2 % i == 0) && (i != 1))
				{
					k = 0;
					break;
				}
			} 
			if (k == 1)
				cout << p1 << " " << p2 << endl;   //?p2???????????p1 p2,??p1+p2=m
		}
	}
	return 0;
}
int main()
{
	int m,i,j,k;
	scanf("%d",&m);
	for(i=3;i<=m/2;i=i+2)
	{
		int r=0;
		for(k=3;k<i*1.0/2;k=k+2)
		{
			if(i%k==0)
			{
				r=1;
				break;
			}
		}
		if(r==1)
		{
			continue;
		}
		j=m-i;
		for(k=3;k<j*1.0/2;k=k+2)
		{
			if(j%k==0)
			{
				r=1;
				break;
			}
		}
		if(r==0)
		{
			printf("%d %d\n",i,j);
		}
	}
	return 0;
}
int main()
{
int m,i,j,k=0,a;//m???????i,j???? .k????1??????????????,a?????i??? 
cin>>m;
for(i=3;i<=(m/2);i=i+2)
    {
    k=0;
    a=m-i;
    for(j=2;j<i;j++)
         {
         if(i%j==0)k++;//?????????????? 
         }
    if(k==0)//???1???????????? 
         {
          k=0;                 
          for(j=2;j<a;j++)
                     {
                     if(a%j==0)k++;//?????????????? 
                     }
          if(k==0)//???1???????????? 
                      {
                      a=m-i;
                      cout<<i<<" "<<a<<endl;                    
                      }                                  
          }              
    }    
cin.get();
cin.get();
return 0;
}
//**************************
//*?????????      *
//*?????? 1200012775 *
//*???2012/10/25        *
//**************************
int main()
{
	int m, p, x, i;//????????????????????
	cin >> m;//????
	if (m % 2 == 0 && m >= 6 && m <= 10000)//?????????
	{
		for (p = 3; p <= (m / 2); p = p + 2)//????p??3????
		{
			x = 1;//??????1?x???
			for(i = 2; i <= sqrt(p); i++)//?p?????
			{
				if(p % i == 0)//p?????????????
				{
					x = 0;//x??0???
					break;//????????????
				}
			}
			for(i = 2; i<= sqrt(m - p); i++)//???m-p?????
			{
				if((m - p) % i == 0)//m-p?????????????
				{
					x = 0;//x??0???
					break;//????????????
				}
			}
			if(x == 1)//????????????
			cout << p << " " << m-p << endl;//??????
		}
	}
	return 0;
}
int main()
{
      int m,i,j,k,a[10000]={0};
    scanf("%d",&m);
    a[2]=1;
    for(i=3;i<=m;i=i+2)
    {
      k=sqrt(i);
      for(j=2;j<=k;j++)
      if(i%j==0)break;
      if(j>=k+1)
      a[i]=1;
     }
    for(i=3;i<=m-3;i++)
    {
      if(a[i]!=0)
      {
      for(j=i;j<=m-3;j++)
      if((j+i==m)&&(a[j]!=0))printf("%d %d\n",i,j);
       }
    }
    return 0;
}
//*******************************
//* Name:Goldbach
//* Author:Sun Zeyu
//* Editting time:2013.10.17
//* Function:Goldbach
//*******************************
int main()
{
	int m,x,a[2000]={0},i,k=0,j;
	cin>>m;
	for(x=3;x<m;x++)
	{
		for(i=2;i<=x/2;i++)
			if(x%i==0)
				break;
		if(i>x/2)
		{
			a[k]=x;
			k++;
		}
	}
	for(i=0;i<k-1;i++)
		for(j=i;j<k;j++)
			if(a[i]+a[j]==m)
				cout<<a[i]<<' '<<a[j]<<endl;
	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;
}
main()
{
	int prime[10010]={0};
	int m;
	int i,j;

	scanf("%d",&m);
	prime[1]=1;
	for(i=2;i<=100;i++)
		for(j=i+1;j<=m;j++)
		{if(j%i==0) prime[j]=1;}

	for(j=3;j<=m/2;j=j+2)
		if(prime[j]==0&&prime[m-j]==0)
			printf("%d %d\n\n",j,m-j);
}
//********************************
//*????1.cpp                ** 
//*?????????           **
//*?????? 1200012834      **
//*???2012.10.22             **
//********************************

int main()
{
    int m, a, b, i, j1=0, j2=0;  // a??????b??????j1?j2?a?b???? 
    cin >> m;
    for(a = 3; a <= m/2; a++)  // a?3???m/2???a<=b 
    {
        b=m-a;   // ??b?? 
        for(i = 1; i <= a; i++)  // ???????a????? 
        {
            if(a % i == 0)
            {
                j1 = j1 + 1;
            }
        }
        for(i = 1; i <= b; i++)  // ???????b????? 
        {
            if(b % i == 0)
            {
                j2 = j2 + 1;
            }
        }
        if(j1 == 2 && j2 == 2)   // ??a?b???2??????a?b???? 
        {
            cout << a << " " << b << endl;  // ??a?b?? 
        }
        j1 = 0;
        j2 = 0;  // ????????????????0 
    }
    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)
      {
          b=n-a;
      l=0;
      for(k=2;k<b;k++)
      {
        if(b%k==0)
        {
         l++;
        }
        else ;
      }
      if(l==0)
            cout << a << " " << b << endl;
      continue;
    }}
    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 su(int n)
{
	int i,l;
	l=sqrt(n);
	for (i=2;i<=l;i++) if (n%i==0) return(0);
	return(1);
}
void main()
{
	int n,i;
	scanf("%d",&n);
	for (i=3;i<=n/2;i++)
	{
		if (i%2!=0&&(n-i)%2!=0&&su(i)&&su(n-i)) printf("%d %d\n",i,n-i);
	}
}
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 main()
{
	int n,i,j,k,l,x,y;
	scanf("%d",&n);
	for(i=3;i<=n/2;i=i+2)
	{
		for(k=3,x=0;k<=(i+1)/2;)
		{
			if(i%k==0)
			{
				x=x+1;
				break;
			}
			else
				k=k+2;
		}
		if(x!=0)
			continue;
		else
		{
		j=n-i;
		for(l=3,y=0;l<=j/2;)
		{
			if(j%l==0)
			{
				y=y+1;
				break;
			}
			else
				l=l+2;
		}
		if(y==0)
			printf("%d %d\n",i,j);
		}
	}
}
int A(int n)
{
	int i,d=0;
	for(i=2;i<n;i++)
	{
		if((n%i)==0)
		{
			d=1;
			return 0;
		}
	}
	if(d==0)
	{
		return 1;
	}
}
int main()
{
	int m,j;
	scanf("%d",&m);
	for(j=2;j<=m/2;j++)
	{
		if(A(j)&&A(m-j))
		{
			printf("%d %d\n",j,m-j);
		}
	}
	return 0;
}
//********************************************
//*?????????                        *
//*??????                              *
//*???1300012888                          *
//*???2013.10.23                          *
//********************************************

int main()
{
	int m, a, b, i, j;

	cin >> m;
	for(a = 3;a <= m / 2;a = a + 2)           //?3????2??
	{                                         //??m?????
		for(i = 2;i <= sqrt(a);)
		{
			if(a % i != 0)                    
				i ++;
			else
				break;
		}
		if(i > sqrt(a))                       //??a???
		{
			b = m - a;
			for(j = 2;j <= sqrt(b);)
			{
				if(b % j != 0)
					j ++;
				else
					break;
			}
			if(j > sqrt(b))                   //??b???
				cout << a << " " << b << endl;
		}
	}
	
	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,a,b,i,j,p,q,s,t;
	scanf("%d",&m);
	for (a=3;2*a<=m;a=a+2)
	{
		q=1;t=1;
		for (i=3;i<a;i=i+2)
		{	
			p=(a%i!=0);q=q*p;
		}
		if (q!=0)
		{
			b=m-a;
			for (j=3;j<b;j=j+2)
			{
				s=(b%j!=0);t=t*s;
			}
			if (t!=0)
				printf("%d %d\n",a,b);
			else continue;
		}
		else continue;
	}
	return 0;
}
int f (int x)
{
	int y=2,z=0;
	while(y<=sqrt(x))
	{
		z=z+!(x-(x/y)*y);
		y=y+1;
		}
	return(z);
}
int main()
{
	int a,b,n;
	a=2;
	scanf("%d",&n); 
	while(a<=(n/2))
	{
		b=n-a;
		if((f (a)*f (a)+f (b)*f (b))==0)
		printf("%d %d\n",a,b);
		a++;
		}
}
int f(int a)
{
    int i,j=0;
    if (a==2)
    return 0;
    else
    {
        for(i=2;i<a;i++)
        {
                        if (a%i==0)
                        break;
                        j++;
        }
        if (j==a-2)
        return 0;
        else
        return 1;
    }
}
main ()
{
    int a,b,c,i,j,k;
    int g[100];
    for(i=0;i<100;i++)
    {
                      g[i]=0;
    }
    scanf("%d",&a);
    j=0;
    for (b=2;b<=a;b++)
    {
        if (f(b)==0)
        {
                    g[j]=b;
                    j++;
        }
    }
    for(i=0;i<j;i++)
    {
                    c=a-g[i];
                    for (k=i;k<j;k++)
                    {
                        if (c==g[k])
                        printf("%d %d\n",g[i],g[k]);
                    }
    }
    getchar();
    getchar();
}
int main()
{
 int m,n,a,b,i1,i2,i3,flag;
 scanf("%d",&a);
 b=a/2;
 for(i1=3;i1<=b;i1=i1+2)
 {
  m=i1;
  n=a-i1;
  flag=0;
  for(i2=2;i2<m;i2++)
  {  
   if(m%i2==0){ flag=flag+1;break;}
  }
  for(i3=2;i3<n;i3++)
  {  
   if(n%i3==0){ flag=flag+1;break;}
  }
  if(flag==0) printf("%d %d\n",m,n);
  }
 return 0;
}
//*********************************************
//*  file: 1.cpp
//*  description???????
//*  Created on: 2012-10-23
//*  Author: ??     1200012858
//*********************************************
int main()
{
	int m, i, j, k, k1, p, q;
	cin >> m;
	for (i = 3; i <= (m / 2); i = i + 2)
	{
		k = (int)sqrt (i);
		for (p = 2; p <= k; p++)
		{
			if (i % p == 0) break;
		}
		    if (p == k + 1)
		    {
		    	j = m - i;
		        k1= (int)sqrt (j);
		        for (q = 2; q <= k1; q++)
		        {
		    	 if (j % q == 0) break;
		        }
		        if (q == k1 + 1)
		    	cout << i << " " << j << endl;
		    }
	}
	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);
           }
       }
   }
   }
//******************************
//*??:???   1200062705    *
//*???:  1 ??????     *
//*?? 2012-12-26             *
//******************************
int main()
{

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

return 0;
}
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;
}
//******************************
//???:4.cpp
//??: ??? 1300012754
//??:2013.10.25
//??:??????
//******************************

int main()
{
	int a[10010];  //????
	int m;  //?????
	int t = 1;  //????m????????????
	int flag = 1; //????
	int b, c; //m??????
	memset(a, 0, sizeof(a)); //?????
	
	a[1] = 2;  //?????????2
	cin >> m;  //???????

	//?????????
	for (int i = 3; i <= m; i++)  //?3????
	{
		//?i????i?????????t???
		for (int j = 1; j <= t; j++)
		{
			flag = 1;  //????????????1???0
			if (i % a[j] == 0) //??????????
			{
				flag = 0;      //?????0
				break;         //exit for
			}
		}
		if (flag == 1)
		{
			a[t+1] = i;  //????t??????????????
			t = t + 1;   //?????????1
		}
	}

	//??????????????????????????2????????????a[2] = 3???
	for (int j = 2; j <= t; j++)
	{
		b = a[j];     //???????
		c = m - a[j]; //????????????????????
		if (b > c)    //????????????????????????????????
			break;

		//??c??????????????
		for (int i = t; i >= 2; i--)
		{
			if (c == a[i])
			{
				cout << b << " " << c << endl; //????????????
				break;
			}
		}
	}
	return 0;
}
int main()
{
	int m,i=0,j=0,a=0,b=0,c=0,d=0;
	scanf("%d",&m);
    for(i=3;i<=(m/2);i=i+2)
	{
		c=0;
		d=0;
		for(a=2;a<i;a++)
		{
			
			b=i%a;
			if(b==0)
			c++;
      
		}
		for(a=2;a<(m-i);a++)
		{
			
			b=(m-i)%a;
			if(b==0)
			d++;
      
		}
		if((c==0)&&(d==0))
			printf("%d %d\n",i,(m-i));

	
		
	}
	return 0;
}
int zhi(int i)
{
    int j,d;
    d=1;
    for(j=1;j<=i/2; j++)  
    {
      if(i%j==0) d=j;
    }
    return (d);
}
int main()
{
    int m,i,j;
    int d=1;
    scanf("%d",&m);
    for(i=3; i<=m/2;i=i+2)  
    {
      j=m-i;
      if (zhi(i) == 1 && zhi(j) == 1) 
	  printf("%d %d\n",i,j);
    }
}
int main()
{
int a,b,n,p,q,i,j;
scanf("%d",&n);
for(a=3;a<=n/2;a=a+2)
 { for(i=3;i<=sqrt(a);i=i+2)
      { p=a%i;
        if(p==0) break;
       }
    if(p!=0 ) 
	{b=n-a;
          if (b!=1) 
     {for(j=3;j<=sqrt(b);j=j+2)
      {q=b%j;
       if(q==0) break;
	 }
      if(q!=0)
	   printf("%d %d\n",a,b);}}
  }
 return 0;
}
int main()
{
	int m,a,b,g=1,l=1;
	double c,d;
	cin>>m;
	for(a=3;a<=m/2;a+=2)
	{
		c=sqrt(a);
		for(int i=2;i<=c;i++)
		{
			if(a%i==0)
			{
				g=0;
				break;
			}
		}
		if(g==1)
		{
			b=m-a;
			d=sqrt(b);
			for(int j=2;j<=d;j++)
			{
				if(b%j==0)
				{
					l=0;
					break;
				}
			}
			if(l==1)
			{
				cout<<a<<" "<<b<<endl;
			}
		}
		g=1;
		l=1;
	}
	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;
}
//********************************
//*?????????  **
//*????? 1300012739 **
//*???2013.10.23  **
//********************************

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

    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 main()
{
	int m;
	cin >> m; 
	int a[10001] = {0};
	int b[10001] = {0};
	int t = 0;
	for(int i = 2; i < m; i++)  // ????????m???????a?
	{
		for(int j = 2; j < m; j++)
		{
			if( i * j > m || a[i*j] != 0 )
				continue;
			a[i*j] = i * j;
			//cout << a[i*j]<< "   ";
			b[t] = i * j ;
			//cout << b[t] << "  ";
			t ++;
			
		}
	}

	int x, p[10001] , q[10001]; 
	int p1, q1;
	for(int i = 3; i <= m/2; i = i + 2)
	{
		x = m - i;      // x ,i ?????
		//????????????
		for(int j = 0; j < t; j++) 
		{
			p[j] = b[j] - i;
			q[j] = b[j] - x;
		}
		p1 = 0;
		q1 = 0;
		for(int j = 0; j < t; j++)
		{
			if( p[j] != 0)
				p1 ++;
			if( q[j] != 0)
				q1 ++;
		}
		if( p1 == t && q1 == t)
			cout << i << " " << x << endl;

	}
	return 0;
}
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);
	}
}
int main()
{
	int m,x,y,a,b,i,j;
	scanf("%d",&m);
	for(x=3;x<=m/2;x++,x++)
	{
		a=sqrt(x*1.0);
		for(i=3;i<=a;i++,i++) 
		{
			if (x%i==0) break;
		}
		if (i>a||x==3||x==5) 
		{
			y=m-x;
			b=sqrt(y*1.0);
			for(j=3;j<=b;j++,j++)
			{
				if (y%j==0) break;
			}
			if (j>b||y==3||y==5) 
				printf("%d %d\n",x,y);
		}
	}
}