semeru/Code-Code-CloneDetection-POJ104 huggingface dataset:
int main()
{
    int m,i,j,k,mod,h=1;
    scanf("%d",&m);
    //????
    for(i=3;i<=m/2;i=i+2) {
                          for(j=2;j<i;j=j+1){
                          mod=i%j;
                          if(mod==0){h=0;}
                          }
                          if(h!=0){
                                      for(k=2;k<(m-i);k=k+1){
                                                             mod=(m-i)%k;
                                                             if(mod==0){h=0;}
                                                             }
                                      if(h!=0){
                                                  printf("%d %d\n",i,m-i);
                                                  }                       
                                      
                                      }
						  h=1;
						
                          }             
  

  return 0;
}
int sushu(int a){
int flag=1;
int m,i;
m=sqrt(a);
for(i=2;i<=m;i++){
if(a%i==0) flag=0;}
return flag;}

int main()
{
	int m,x,y,k,i;
	scanf("%d",&m);
	
	for(k=3;k<=m/2;k+=2){
		if(sushu(k)&&sushu(m-k)) printf("%d %d\n",k,m-k);}	
	
	return 0;
}
void main() {
	int m,n,i,k,a[10000],j = 0,p;
	scanf("%d",&m);
	for (n = 3;n < m;n+=2) {
		k=sqrt(n);
		for (i = 2;i <= k;i++)
			if (n%i == 0) break;
		if (i >= k+1) a[j++] = n;
	}
	for (i = 0;i < j-1;i++)
		for (p = i;p < j;p++)
			if (a[i]+a[p] == m) printf("%d %d\n",a[i],a[p]);
}
//********************************
//*?????????   **
//*?????? 1300012861 **
//*???2013.10.17  **
//********************************
int main()
{
	int n, x, y, i, r, j, s; 
	cin >> n; 
	for (x = 3; x <= n / 2; x += 2) //??? ???3?? ??+2
	{
		y = n - x; 
		r = sqrt (x);
		s = sqrt (y);
		for (i = 2; i <= r; i++) //??x?????
		{
			if (x % i == 0) //????????
			{
				break; 
			}
		}
		for (j = 2; j <= s; j++) //??y?????
		{
			if (y % j == 0)
			{
				break; 
			}
		}
		if ((i == r + 1) && (j == s + 1)) //?x?y??????????? ?????
			cout << x << ' ' << y << endl; 
	}
	return 0;
}
int main()
{
	int m,a,b,j,i,sgn1=0,sgn2=0;
	scanf("%d",&m);
	for (a=3;a<=m/2;a++)
		{
			for(j=2;j<=a/2+1;j++)
			{
			if(a%j==0)
			{
				sgn1=0;
				break;
			}
			else sgn1=1;
		}
			if (sgn1==0) continue;
			for(i=2;i<=(m-a)/2+1;i++)
			{
			if((m-a)%i==0)
			{
				sgn2=0;
				break;
			}else sgn2=1;
		}
		if(sgn1&&sgn2)
			printf("%d %d\n",a,m-a);
	}
	return 0;
}
int ss(int x)
{
  double m;
  int i,f=0;
  m=sqrt(x);
  if(x%2==0) return 0;
  for(i=3;i<=m;i++)
    {
      if(x%i==0)               
       {
         f=1;
         break;                        
       }      
    }
  if(f==1) return 0;
  else return 1;
}
int main()
{
  int n,l,f,m;
  double k;
  int i,j,p;
  scanf("%d",&p);
    l=p/2;
    for(i=3;i<=l;i+=2)
       if(ss(i)&&ss(p-i))
       printf("%d %d\n",i,p-i);
    return 0;
}
int prime(int n)
{
	int i,product=1;
	for(i=2;i*i<=n;i++)
	{
		if(n%i==0)
			product=0;
	}
	return(product);
}
int main()
{
	int N,j,check;
	cin>>N;
	for(j=3;j<=N/2;j++)
	{
		check=prime(j)*prime(N-j);
		if (check>0)
		{
			cout<<j<<' '<<N-j<<endl;
		}
	}
	return 0;
}
int sushu(double a)
{
	int i,n,s;
	if((int) a%2==0)
	{
		return 0;
	}
	s=sqrt(a);
	for(i=3;i<=s;i+=2)
	{
		if((int)a%i==0)
			return 0;
	}
	return 1;
}
int main()
{
	int m,i,n;
	scanf("%d",&m);
	for(i=3;i<=m/2;i++)
	{
		if(sushu((double) i)&&sushu((double) m-i))
		{
			printf("%d %d\n", i,m-i);
		}
	}
}
int main()

{

	int a[20000]={0},b[20000]={0},i,m,j,k;

	cin>>m;
		
	for(i=3;i<m;i=i+2)

	{

		a[i]=i;

		for(j=3;j<i;j=j+2)

		{

				if(i%j==0)
				a[i]=0;


		}

	}

	for(i=3;i<=m/2;i=i+2)
	if (a[i]==i&&a[m-i]==m-i)

	{

				cout<<a[i]<<" "<<a[m-i]<<endl;


	}
			return 0;
}
int F(int n){
    int m,i,j,s=1;
    m=sqrt(n);
    for(i=2;i<=m;i++){
        for(j=m;j<=n;j++){
            if(n==i*j){
                s=0;
                return 1;
                break;
            }
        }
    }
    if(s==1) return 2;
}

int main()
{
    int t,k,p;
    scanf("%d",&t);
    for(k=3;k<=t/2;k++){
        if(F(k)==2){
            p=t-k;
            if(F(p)==2){
                printf("%d %d\n",k,p);
            }
        }
    }
    return 0;
}
int main()
{
	int m,i,j,k,l;
	scanf("%d",&m);
	for (i=3;i<=(m/2);i++)
	{
		for (j=2;j<=i;j++)
		{
			if (i%j==0)
				break;
		}
		for (k=2;k<=m-i;k++)
		{
			if((m-i)%k==0)
				break;
		}
		if (i==j)
		{
			if(m-i==k)
			{
				printf("%d",i);printf(" ");printf("%d\n",(m-i));
			}
		}
	}
}
int main()
{
	int m,i,p,k;
	int judge(int af);
	cin>>m;
	for(i=3;i<=m/2;i+=2)
	{
		p=judge(i);
		k=judge(m-i);
		if(p!=1&&k!=1)
			cout<<i<<" "<<m-i<<endl;
	}
	return 0;
}


int judge(int af)
{
	int j;
	for(j=3;j<af;j+=2)
	{
		if(af%j==0)
		{
			return 1;
			break;
		}
	}
}
int main()
{
	int n,m,i,j,k;
	scanf("%d",&n);
	for(i=3;i<=(n/2);i=i+2)
	{
		for(j=2;j<=sqrt(i);j++)
		{
			if(i%j==0)
				break;
		}
		if(j>sqrt(i))
		{
			m=n-i;
			for(k=2;k<=sqrt(m);k++)
			{
				if(m%k==0)
					break;
			}
			if(k>sqrt(m))
			{
				printf("%d %d",i,n-i);
				printf("\n");
			}
		}
	}
	return 0;
}
//* ????2??m???
   //* ????
//*****
int susucheck(int a)
{int j;int flag=1;int l;
for(j=2;;j++)
{if(j*j<=a){ l=a/j;if(l*j==a) flag=0; }
else break;}
return flag;
}
int main()
{int m;
cin>>m;
int k;int i;
for(k=2;k<=m/2;k++)
	{if(susucheck(k)&&susucheck(m-k))


	cout<<k<<' '<<m-k<<endl;}
return 0;

}
int main()
{
	int m , a;
	cin >>m;
	cout <<endl;
	for (int i = 2;i <= m/2;i++)//??i?????
	{
		if (i%2 == 1)
		{
		   int l=0;
		   for (int k = 2;k <= floor(sqrt(i));k++)//??i?????
			   if (i%k == 0) l = l + 1;
		   if (l == 0) 
	          {
		   int h = 0;
	             a = m - i ;//?i????m?????a????
	           for (  int b = 2;b <= floor(sqrt(a));b++)//??a?????
				  if (a%b == 0) h = h + 1;
			  if (h == 0)
			      cout << i <<" "<< a <<endl;
	           }
                     }
	}
      return 0;
}
int main ()
{
	int m, s, p,i,j;
	cin >>m;
	for (s = 3; s <= m / 2;s = s + 2)
	{
		p = m - s;
		for ( i = 2; i <= (int) sqrt (s); i = i + 1 )
			{if ( s % i == 0 )
			break;}
		for ( j = 2; j <= (int) sqrt (p); j = j + 1 )
			{if ( p % j == 0 )
			break;}
		if ( j == (int) sqrt (p) + 1 && i == (int) sqrt (s) +1)
			cout << s << " " <<p <<endl;
	}
	return 0;
}
int main()
{
	int i,j,k;
	int n;
	int a[10000]={0};
	for(i=0;i<10000;i++)
		if(i%2)
			a[i]=i;
	for(i=3;i<100;i=i+2)
		for(j=i+2;j<10000;j++)
			if(a[j])a[j]=j%i;
	for(i=0;i<10000;i++)
		if(a[i])
			a[i]=i;
	scanf("%d",&n);
	for(i=3;i<n/2+1;i++)
	if(a[i]&&(a[n-a[i]]))
		printf("%d %d\n",a[i],n-a[i]);

}
int main()
{
	int m;
	int j;
	int i;
	int a,b,e;
	scanf("%d",&m);
	for(i=3;i<=m/2;i++)
	{
		e=0;
		for(j=2;j<i;j++)
		{
			if(i%j==0)
			{
				e++;
			}
		}
		if(e==0)
			{
				a=i;
				b=m-a;
				e=0;		
				for(j=2;j<b;j++)		
				{			
					if(b%j==0)			
					{				
						e++;			
					}
				}
				if(e==0)
				{
					printf("%d %d\n",a ,b);
				}
		}
	}
}
//************************************************
// ?? ?1.cpp                                  *
// ?? ????    1200012925                   *
// ?? ?10?22?                               *
// ?? ?????????                       *
//************************************************
int main()
{
//??????? ????????????
	int n, a, b, i, m, sum, sum2;
//?????????
	cin >> n;
//??????????
	for (i = 1 ; i <= (n - 2) / 4 ;  i ++)
	{
		a = 2 * i + 1 ;
		sum = 0;
//??a???		
		for (m = 1 ; m < a ;  m ++)
		{
		     if (a % m != 0 )
				sum = sum + 1 ;
		}
//?????a?????? ???
//?a ?????????b ?????
//?????a 
		if ( sum == a - 2 )
			{
				b = n - a ;
				sum2 = 0;
				for (m = 1 ; m < b ; m = m++)
				{
					if ( b % m != 0 )
						sum2 += 1 ;
//???????? ????
					if ( sum2 == b - 2 )
						cout << a <<" " << b << endl ;
				}
			}
	}
	return 0 ;
}
int main()
{
    int m,i,j,n;
	scanf("%d",&m);
	for(i=3;i<=m/2;i+=2)
	{
		for(j=3;j*j<=i;j+=2)
			if(i%j==0)
				break;
		if(j*j<=i) 
			continue;
		n=m-i;
		for(j=3;j*j<=n;j+=2)
			if(n%j==0)
				break;
		if(j*j>n)
			printf("%d %d\n",i,m-i);

	}
					
    return 0;
}
//*****************************************************************
//??????
/*?????????????????????????m?m>=6????
int????????????2??????????1?????????
??????*/
//*****************************************************************
int check(int a)                           //?????????????
{
	int i,k;
	k=0;
	if(a==2||a==3)                     //?????????else??????
		k=0;
	else
	{
		for(i=2;i<a;i++)
		{
			if(a%i==0)
			{
				k=k+1; 
				break;
			}   
		}     
	}                                     
	if(k==0)
		return a;                         //?????a
	else
		return 0;                         //?????0
}                                                 
int main()
{
   int m,i,j;
   cin>>m;
   for(i=2;i<m;i++)
   {
      if(check(i)==0)                   //??i?????
		  continue;
	  else
	  {
	     j=m-i;
		 if(check(j)==0||j==1)                //??m-i?????
			 continue;
		 else
		 {
			if(i<=j)                 
			    cout<<i<<' '<<j<<endl;      //????????
			                                //i?j???????????i<m??????i<j.
		 }
	  }
   }
   cin.get();
   return 0;
}
int main()
{
	int i,j,m,s,t;
	scanf("%d",&m);
	for(i=3;i<=m/2;i=i+2)
	{for(j=2;j<=m;j++)
	{t=0;if(((m-i)!=j)&&(i!=j)&&((i%j==0)||((m-i)%j==0))){t=1;break;}}
	if(t==0)
		printf("%d %d\n",i,m-i);}

return 0;
}
int main()
{
	int m, primeA, primeB;
	int i, k;
	cin >> m;
	for (primeA = 3; primeA <= m - 1; primeA +=2)
	{
		primeB = m - primeA;
		for (i = 2; i <= (int)sqrt(m); i++)
		{
			if (primeA % i == 0 && primeA != i)
			{
				break;
			}
		}
		for (k = 2; k <= (int)sqrt(m); k++)
		{
			if (primeB % k == 0)
			{
				break;
			}
		}
		if ((i == (int)sqrt(m) + 1) && (k == (int)sqrt(m) + 1) && (primeA <= primeB))
			cout << primeA << " " << primeB << endl;
	}
	return 0;
}
int main()
{
int a[2000];
int i,j,k,l,n,m;
n=0;
for (i=0;i<=1999;i++)
a[i]=0;
for (i=2;i<=10000;i++)
{
k=0;
for (j=2;j<=sqrt(i);j++)
{
if (i%j==0)
{
k=1;
break;
}
}
if (k==0)
{
a[n]=i;
n++;
}
}
scanf("%d",&m);
for (i=1;a[i]!=0;i++)
{
for (j=i;a[j]!=0;j++)
{
if (a[i]+a[j]==m)
{
printf("%d %d\n",a[i],a[j]);
}
}
}
return 0;
}
int main()
{
  int isprime(int n);
  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);
  }
  
}
int isprime(int n)
{
   int i;
   for (i=2;i*i<=n;i++)
     if (n%i==0)
       return 0;
   return 1;
}
int ss(int n)
{
int i,j,t=0;
for(i=2;i*i<=n;i++)
{
if(n%i == 0)
break;
}
if(i*i>n)
return 1;
else
return 0;
}
int main()
{
	int m,a;
	scanf("%d",&m); 
	for(a=3;a<=m/2;a++)
	{           
	   if(ss(a)&&ss(m-a))
	   {
	      printf("%d %d\n",a,m-a);
	   }
	}
	return 0;
}
//int main()

    int f(int n)
    {
        int j=0,m;
        //if(n==2)
        //return 1;
        //else
        
          for(int i=2;i<n;i++)
          {
                m=n%i;
                if(m==0)
                j=j+1;
                
          }
          if(j==0)
          return 1;
          else
          return 0;
        
    }
int main()
{
    int n,h;
    scanf("%d",&n);
    for(int k=2;k<=n/2;k++)
    {
       h=n-k;
       if((f(h)==1)&&(f(k)==1))
       printf("%d %d\n",k,h);
    }
    getchar();
    getchar();
    
}
//***************************** 
//* &sup3;&Igrave;&ETH;ò&Atilde;&ucirc;&pound;&ordm; &cedil;&ccedil;&micro;&Acirc;°&Iacute;&ordm;&Otilde;&sup2;&Acirc;&Iuml;&euml;    ** 
//* ×÷&Otilde;&szlig;&pound;&ordm; &Agrave;&icirc;&Otilde;&aelig;&Ograve;&raquo; 1300012948 ** 
//* &Ecirc;±&frac14;&auml;&pound;&ordm; 2013.10.24        ** 
//*****************************
int main()
{
    int m, a, b, k, n;
    cin >> m;
    for(int i = 3; i <= (m / 2); i += 2)
    {
            a = (int)sqrt(i * 1.0);
            for(k = 2; k <= a + 1; k++)
            {
                    if(i % k == 0)
                    break;
                    else
                    continue;
            }
            if(k > (a + 1))
            {
                 b = (int)sqrt((m - i) * 1.0);
                 for(n = 2; n <= b + 1; n++)
                 {
                         if((m - i) % n == 0)
                         break;
                         else
                         continue;
                 }
                 if(n > (b + 1))
                 cout << i << " " << (m - i) << endl;
            }
    }
    return 0;
}
int fun(int x)
{ 
    int b=1;
    for(int a=2;a<x;a++)
    {
       if(x%a==0)
       {
          b=0;
          break; 
       }   
    } 
    return b;
}
main()
{
   int m,n,k,i;
   scanf("%d",&m);
   n=m/2;
   k=(n+1)/2;
   for(i=2;i<=k;i++)
   {
      int c=2*i-1;
      if(fun(c)==1&&fun(m-c)==1)
         printf("%d %d\n",c,m-c);                         
   }
   getchar();
   getchar();
}
int main()
{
	int m,n,k,j,i,l,p;
	scanf("%d",&m);
	for(n=3;n<=m/2;n++){
		p=sqrt(n);
		for(i=2;i<=p;i++){
			if(n%i==0)break;
		}
		if(i>p){
			k=m-n;
			l=sqrt(k);
			for(j=2;j<=l;j++){
					if(k%j==0)break;
			}
			if(j>l)
				printf("%d %d\n",n,k);
					}
			
		
	}
	return 0;
}
int su(int n)
{
int a=n;
int b=0;
int c=sqrt(n);
for(int d=2;d<=c;d++)
{
if((a%d)==0) b=b+1;
}
b=(b==0);
return(b);
}
int main()
{
	
	int b;
	cin>>b;
	for(int i=1;i<=(b+4)/4;i++)
	{int t=2*i+1;
	 
	if ((su(t)==1)&&(su(b-t)==1)&&(t<=(b-t)))
		cout<<t<<" "<<b-t<<endl;

	}

}
int SUSHU (int x)
{
	int d = 2, none = 1, result = 0;
	while (d * d <= x)
	{
		if (x % d == 0)
		{
			none = 0;
			break;
		}
		else
			d += 1;
	}
	if (none == 1)
		result = 1;
	return result;
}

int main()
{
	int m, a = 3, b;
	cin >> m;
	while (2 * a <= m)
	{
		b = m - a;
		if ((b % 2 != 0) && (SUSHU(a) == 1) && (SUSHU(b) == 1))
		{
			cout << a << " " << b << endl;
		}
		a += 2;
	}
}
int main()
{
    int n;
    int a,b;
    int i,k,l,j;
    cin >> n;
    for(a=3;a<=n/2;a=a+2)
    {
       j=0;                  
      for(i=2;i<a;i++)
      {if(a%i==0)
        {j=j+1;}
      }
      if(j==0)
      {
          b=n-a;
      l=0;
      for(k=2;k<b;k++)
      {
        if(b%k==0)
        {l=l+1;}
      }
      if(l==0)
            cout << a << " " << b << endl;
      continue;
    }}
    return 0;
}
int main()
{
int num,p,q;
int i,j;
cin>>num;
for(p=3;p<=(num/2);p=p+2)
{for(i=2;i<p;i++)
{if(p%i==0)
{break;}
if(i==p-1)
{q=num-p;
for(j=2;j<q;j++)
{if(q%j==0)
{break;}
if(j==q-1)
{cout<<p<<" "<<q<<endl;}
}
}
}
}
return 0;
}
int leap(int a)
{
	int t=1,i=0;
	if(a==2||a==3)  return t;
	else
	{
		for(i=2;i*i<=a;i++)
       	{  
			if(a%i==0)
		   { 
			t=0;
			break;
		    }
		}
	}
	return t;
}
int main()
{
	int i,m;
	scanf("%d",&m);
	for(i=2;i<=m/2;i++)
	{
		if(leap(i)&&leap(m-i))
		{
			printf("%d %d\n",i,m-i);
		}
	}
	return 0;
}
int main()
{
    int m,i,ii,tf,k;
    cin>>m;
    i=2;
	while (i<m/2+1)
    {
		ii=1;
		while (ii<(i/2+1))
		{
			ii=ii+1;
		    if (i%ii==0)
            {    
				tf=0;
			    break;
			}
			else
			    tf=1;
		}
        ii=1;
        while (ii<((m-i)/2+1))
        {
			ii=ii+1;
            if ((m-i)%ii==0)
                tf=0;
            else
			    tf=tf*1;
		}
        if ((tf==1)&&(i!=1)&&(m-i!=1))
		    cout<<i<<" "<<(m-i)<<endl;
        i++;
    }
	cin>>k;
    return 0;
}
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]);
                    }
    }
}
int n;
void main()
{
	int a;
	scanf("%d",&n);
	for(a=3;a<=n-a;a+=2){
		if(chose(a)&&chose(n-a))
			printf("%d %d\n",a,n-a);
	}
}
int chose(int n)
{
	int i;
	if(n==3)
		return 1;
	else if(n%2){
		for(i=3;i<=sqrt(n)+2;i+=2)
			if(!(n%i))
				break;
		if(i>sqrt(n))
			return 1;
		else
			return 0;
	}
	else
		return 0;
}
int main()
{
	int n, k, g, a, b;
	cin >> n;

	for (a = 3; a <= n / 2; a += 2)
	{
		k = 0; g = 0;
		for (int i = 3; i <= a; i += 2)
		{
			if (a % i != 0)
				continue;
			else
				k++;
		}
		b = n - a;
		for (int i = 3; i <= b; i += 2)
		{
			if (b % i != 0)
				continue;
			else
				g++;
		}
		if (k == 1 && g == 1)
			cout << a << " " << b << endl;
	}
	return 0;
}
/*??
 Geeker???????????????????????????????????????????????????????m?m>=6????int????????????2??????????1???????????????

 ????
 ????m?m?????6 <= m <= 10000

 ????
 2???m?????????????????????????????????2???????????????????????????????????????????????????????????

 ????
 40

 ????
 3 37
 11 29
 17 23


 *
 */
int main()
{
	int m,a,b,i,x,y;
	cin>>m;
	for(a=3;a<=(m/2);a++)
	{
		b=m-a;
		int x=y=0;
		for(int i=2;i<=floor(sqrt(a));i++)
		{
			if(a%i==0)
			{
				x++;
			}
		}
		for(int i=2;i<=floor(sqrt(b));i++)
		{
			if(b%i==0)
			{
				y++;
			}
		}
		if(x==0&&y==0)
		{
			cout<<a<<" "<<b<<endl;

		}

	}
	return 0;
}
int main()
{
	int m,a,k,b;
	scanf("%d",&m);

	if(m==6)
		printf("3 3\n");
	else
	{
		for(k=1;4*k+2<=m;k++)
		{
			a=2*k+1;
			b=m-a;

			int i=2;
			while(i*i<=a)
			{
				if(a%i==0) break;
				i++;
			}

			int j=2;
			while(j*j<=b)
			{
				if(b%j==0) break;
				j++;
			}

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

	return 0;
}
void main() 
{
 int a,b,c,d;  
 scanf("%d",&a); 
 for(b=3;b<=a/2;b+=2) 
 { 
  for(c=2;c<=sqrt(b);c++)   
   if(b%c==0) break;
  if(c>sqrt(b))   
   d=a-b;
  else
   continue;    
  for(c=2;c<=sqrt(d);c++) 
   if(d%c==0) break; 
  if(c>sqrt(d)) 
   printf("%d %d\n",b,d);
 } 
}
int pa(int i);
int main()
{
	int m,i,p,q,a,b;
	scanf("%d",&m);
	for(i=1;2*i<m-3;i++)
	{
		a=2*i+1;
		b=m-1-2*i;
		p=pa(a);
		q=pa(b);
		if(p==0&&q==0&&a<=b)
		{
			printf("%d %d\n",a,b);
		}
	}
	return 0;
}

int pa(int i)
{
	int k,t=0;
	for(k=i-1;k>1;k--)
	{
		if (i%k==0){t++;}
	}	
	return t;
}
main()
{
      int a(int x);//????????? 
      int m,i,k;
      scanf("%d",&m);
      for(i=2;i<m/2+1;i++)
      {
                          if(a(i)==1&&a(m-i)==1)
                          printf("%d %d\n",i,m-i);
      }
      getchar();
      getchar();
}
int a(int b)
{
    int i,c=1;
    for(i=2;i<b;i++)
    {
                    if(b%i==0)
                    {
                          c=0;
                          break;
                    }
    }
    return(c);
}
int main()
{
	double n;
	cin >> n;
	int i,j;
	int k,l;
	double t,s;
	for(i=3;i<=n/2;i+=2)
	{
		t=sqrt((double)i);
		for(j=2;j<=t;j++)
		{
			if(i%j==0)
				break;
		}
		if(j>t)
		{
			l=n-i;
			s=sqrt((double)l);
			for(k=2;k<=s;k++)
			{
				if(l%k==0)
					break;
			}
			if(k>s)
			{
				cout << i << " "<< l<<endl;
			}
		}
	}
	return 0;
}
main ()
{
int m,a,b,i,t;
scanf("%d",&m);
 for(a=2;a<=m/2;a++)
 {
  t=0;
  for(i=2;i<a-1;i++)
  {
   if(a%i==0)t=1;
  }
 if(t==0)
 {
 b=m-a;
 t=0;
for(i=2;i<b-1;i++)
  {
   if(b%i==0)t=1;
  }
if(b==1)t=1;
if(t==0)printf("%d %d\n",a,b);
 }
 }
}
int f(int n,int m)
{
    int i,sushu,j;
    sushu=0;
    for(i=2;i<=sqrt(n);i++)
    {
        if(n%i==0)
        {
            sushu=-1;
        }

    }
    if(sushu==0)
    {
        for(j=2;j<=sqrt(m-n);j++)
        {
            if((m-n)%j==0)
            {
                sushu=-1;
            }
        }
    }
    if(sushu==0)
    {
        printf("%d %d\n",n,m-n);
    }
}


int main()

{
    int exp,c,b,a[100],days,w,m;
    int i,t,T,n,s,t2,j,k,len,x,y,ip,u;

    long e,p,q,r,sp,sq,sr;

    double d,h,g[100];

    scanf("%d",&m);
    for(i=3;i<=m/2;i=i+2)
    {
        f(i,m);
    }
    return 0;
}
int prime(int a)
{
int i,n;
if(a==1)return 0;
n=(int)sqrt((double)a);
for(i=2;i<=n;i++)
if(a%i==0)return 0;
 return 1; 
}
void main()
{ 
  int i,m;
  scanf("%d",&m);
  for(i=3;i<=m/2;i=i+2)
  { if(prime(i)&&prime(m-i)) {printf("%d %d\n",i,m-i); continue;}}
}
void main()
{
 int flag(int n);
 int m,i,a,b;
 scanf("%d",&m);
 while((m>=6)&&(m%2==0))
  {
   for(i=2;i<=m/2;i++)
    {
      if(flag(i)==0&&flag(m-i)==0)
      printf("%d %d\n",i,m-i);
    }
   break;
  }
}
int flag(int n)
{
 int c,k,i;
 k=sqrt(n);
 for(i=2,c=0;i<=k;i++)
  { 
   if(n%i==0) 
    {c=1;break;}
  }
 return(c);
}
int main()
{
     int m,i,j,a,b;
      scanf("%d",&m);
     for(i=1;i<=m/2;i++)
     {
               a=2;         
          while(i%a!=0&&a<=i) 
            a++;
         if(a==i){
                    b=2;
           while(((m-i)%b!=0)&&(b<=m-i)) 
              b++;
         if(b==m-i) 
           printf("%d %d\n",i,m-i);
             }
         }
    return 0;
}
int main()
{
 int n,j,i;
 char isprime[MAXN+1]={0,0};
 scanf("%d",&n);
 for(i=2;i<=n;i++)
 {
	 isprime[i]=1;
 }
 for(i=2;i<=n/2;i++)
 {
	 if(isprime[i])
	 {
		 for(j=i+i;j<=n;j+=i)
		 {
			 isprime[j]=0;
	 }
 }
 }

	for(j=2;j<=n/2;j++)
	{
		if(isprime[j]&&isprime[n-j])
		{
			printf("%d %d\n",j,n-j);
		}
	}


return 0;
}
int main()
{
	int m,i,k,x,p=0,q=0;
	scanf("%d",&m);
	if(m==6)
		printf("3 3");
	else
	for(i=3;i<=m/2;i+=2)
	{
		k=m-i;
		for(x=2;x<=sqrt(i);x++)
		{
			if((i%x)==0)
				p=1;
		}
		for(x=2;x<=sqrt(k);x++)
		{
			if((k%x)==0)
				q=1;
		}
		if(p==0&&q==0)
			printf("%d %d\n",i,k);
			p=0;
			q=0;
	}
	return 0;
}
int judge(int x)
{
    int i,j=1;
    for(i=2;i*i<=x;i++)
    if(x%i==0)
    {
        j=0;
        break;
    }
    return j;
}
void main()
{
    int m,i,j,p,q;
    scanf("%d",&m);
    for(i=2;i<m;i++)
    if(judge(i))
    {
        p=i;
        for(j=i;j<m;j++)
        if(judge(j))
        {
            q=j;
            if(p+q==m)
            {
                printf("%d %d\n",p,q);
                break;
            }
        }
    }
}
//********************************
//*?????????   **
//*?????? 1200012837 **
//*???2012.10.22  **
//********************************

int main()
{
	int m;
	double x, y;
	cin >> m;
	for(x = 3; x <= m / 2; x += 2)
	{
		int i = 2;
		for(; i <= (int)sqrt(x); i++)
		{
			if((int)x % i == 0)
				break;
		}
		if(i == (int)sqrt(x) + 1)
		{
			y = m - x;
			int k = 2;
			for(; k <= (int)sqrt(y); k++)
			{
				if((int)y % k == 0)
					break;
			}
			if(k == (int)sqrt(y) + 1)
				cout << x << " " << y << endl;
		}
	}

	return 0;
}
void gbc(int n);
int ispn(int p);
int main()
{
	int n;
	scanf("%d",&n);
	gbc(n);
return 0;
}
void gbc(int n)
{
	int half=n/2;
	int i;
	int a,b;
	for(i=3;i<=half;i=i+2)
	{
		a=ispn(i);
		b=ispn(n-i);
		if(a&&b)
		{
			printf("%d %d\n",i,n-i);
		}
	}
}
int ispn(int p)
{
	int i,half,isprime;
	isprime=1;
	if(p%2==0)
	{
		if(p==2)
		{
			return isprime;
		}else
		{
			isprime=0;
		return isprime;
		}
	}
	half=p/2;
	for(i=3;i<=half;i=i+2)
	{
		if(p%i==0)
		{
			isprime=0;
			break;
		}
	}
	return isprime;
}
int main(void)
{
    int i,j,m,k=0,temp=0;
    cin>>m;
    int arr_a[1300];
    for (i=3;i<=m;i++)
    {
        for (j=2;j<=floor(sqrt(i));j++)
            if (i%j==0) temp++;
        if (temp==0) arr_a[k++]=i;
        temp=0;
    }
    for (i=0;i<k;i++)
    {
        for (j=i;j<k;j++)
            if (arr_a[i]+arr_a[j]==m)
               cout<<arr_a[i]<<" "<<arr_a[j]<<endl;
    }
    return 0;
}
void main()
{
    int m,k,i,j,t,s;
    scanf("%d",&m);
    for(i=3;i<=m/2;i=i+2)
    {
                    t=(int)sqrt(i);
                    s=0;
                    for(k=3;k<=t;k=k+2)
                    {s=0;
                    if(i%k==0) {s=1;break;}}
                    if(s==0)
                    {
                            j=m-i;
                            t=(int)sqrt(j);
                            for(k=3;k<=t;k=k+2)
                            {s=0;if(j%k==0) {s=1;break;}}
                            if(s==0)
                            printf("%d %d\n",i,j);
                    }   
    }
}
int main()
{
	int m;
	int a[10000];
	int i,j,k;
	for(i=2,k=0;i<10000;i++)
	{
		for(j=2;j<=i;)
		{
			if(i%j==0)
				break;
			j++;
		}
		if(j==i)
		{
			a[k]=i;
			k++;
		}
	}
	scanf("%d",&m);
	for(i=0;a[i]<=m;i++)
	{
		for(j=i;a[j]<=m-a[i];j++)
		{
			if(a[i]+a[j]==m)
			{
				printf("%d %d\n",a[i],a[j]);
			}
		}
	}
	return 0;
}