semeru/Code-Code-CloneDetection-POJ104 huggingface dataset:
//??????
int main()
{
	int m,i=3,j,x,y;                           //m??????  i??3?????  j?m-i x?y???i,j???????????
	int a,b,c=1;
	cin>>m;
	for(i=3;i<=m/2;i=i+2)                    //i?3?m/2?????
	{
		c=1;
		j=m-i;
		x=sqrt(i);
		y=sqrt(j);
		for(a=2;a<=x;a++)             //?a?2?x?????i?????
		{
			if(i%a==0)               //??i??a??  c=0 ?????
			{
				c=0;
				break;
			}
		}
		for(b=2;b<=y;b++)        //?b?2?y?????j?????
		{
			if(j%b==0)           //??j??b??  c=0 ?????
			{
				c=0;
				break;
			}
		}
		if(c==1)                //?c=1???i j ???
		{
			cout<<i<<" "<<j<<endl;
		}
	}
	return 0;
}
main()  {
     int i,j=0,n,k=1,t,m;
   scanf("%d",&m);
     int a[m];
      for(n=3;n<=m;n+=2)
  {    t=sqrt(n);i=2;
          for(i=2;;i++)
        { if(n%i==0) break;
        if(i>t)  { a[j]=n;j++;break; }}

     }
  t=0;
       for(i=0;i<=j;i++)
           for(k=i;k<=j;k++)
              {     if(a[i]+a[k]==m)
                        { t++; 
                          printf("%d %d\n",a[i],a[k]);
                              }  
                    }
                    if(t==0) 
                    printf("no\n"); 
               }
int main(int argc, char *argv[])
{
  int m,i,j,flag1,flag2;
  scanf("%d",&m);
  for (i=3;i<=m/2;i+=2)
  {
      flag1=1;
      flag2=1;
      for (j=2;j<=i-1;j++)
      {
          if (i%j==0)
          {flag1=0;break;}
      }
      for (j=2;j<=m-i-1;j++)
      {
          if ((m-i)%j==0)
          {flag2=0;break;}
      }
      if ((flag1==1)&&(flag2==1))
      printf("%d %d\n",i,m-i);
  }
	
  return 0;
}
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 main()
{
	int x,i,j,bl,g,a[2001],b[10001];
	cin>>x;
	if (x<6||x%2==1)
	{
		cout<<"Error!";
	}
	else 
	{
		g=0;
		for (i=3;i<=x;i++)
		{
			bl=0;
			for (j=2;j<i;j++)
				if (i%j==0)
				{
					bl=1;
					break;
				}
			if (bl==0)
			{
				g++;
				a[g]=i;
				b[i]=1;
			}
		}
      for (i=1;i<=g;i++)
	  {
		  if (a[i]*2<=x)
		  {
			  if (b[x-a[i]]==1)
			  {
				  cout<<a[i]<<" "<<x-a[i]<<endl;
			  }
		  }
		  else break;
	  }
	}
}
int main()
{
	int m, i, j, k, t, p, q;
	cin >> m;
	for(i=3;i<=m/2;i=i+2)                //???3?????????
	{
		for(t=1,k=2;k*k<=i;k++)          //?????????????t????????????????
		{
			if(i%k==0)
			{
				t=0;
			    break;                   //??????t=0,????????????      
			}
		}
		if(t==1)                         //t!=0,???????
		{
			j=m-i;                       
			for(p=1,q=2;q*q<=j;q++)      //????????????????????????
			{
				if(j%q==0)
				{
					p=0;
				    break;
				}
			}
			if(p==1)
				cout << i <<" "<< j << endl;   //?????????????i??????????i??j,i??
		}
	}
	return 0;
}
int main()
{
   int n, i, j, a[10000], flag=0;
   scanf("%d",&n);
   for (i=3;i<=n;i++)
   {
   for(j=2;j<i;j++)
   {if(i%j==0)
   break;
   }
   if(j==i)
   {flag+=1;
   a[flag]=i;
   }  
   }
     for(i=1;i<=flag;i++)
     {
     for(j=i;j<=flag;j++)
     {
     if(a[i]+a[j]==n)
     {printf("%d %d\n",a[i],a[j]);
     break;  
     }
     }
     }
     return 0;
}
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,i,k,t,s=0,p=0;
   scanf("%d",&m);
   i=3;
   k=1;
   t=1;
   while(i<=m/2)
   {
	   while(k<=i)
	   {if(i%k==0)
			s=s+1;
		   else;
		   k=k+1;}
	   if(s==2)
	   {
		   while(t<=m-i)
		   {if((m-i)%t==0)
		      p=p+1;
		      else;
			  t=t+1;}
		   if(p==2)
			   printf("%d %d\n",i,m-i);
		   else;
	   }
	   else;
	   s=0;
	   p=0;
	   t=1;
	   k=1;
	   i=i+1;
   }
return 0;
}
int su(int p)
 {
 int i,j,w;
 w=1;
 for (i=2;i<p;i++)
  if (p%i==0) w=0;
  if (w==1) return(1);
   else return(0);
   }
main()
{
int m,i,j,k;
scanf("%d",&m);
for (i=3;i<m/2+1;i++)
 if ((su(i)==1)&&(su(m-i)==1)) printf("%d %d\n",i,m-i);
 }
int main()
{
	int m,n,t,l,i,j;
	scanf("%d",&m);
	for(i=2;i<=m/2;i++)
	{
		t=1;
		l=1;
		for(j=2;j<=i/2;j++)
		{
			if(i%j==0)
			{
				t=-1;
				break;
			}
		}
		if(t==1&&i%2!=0)
		{
			n=m-i;
			for(j=2;j<=n/2;j++)
			{
				if(n%j==0)
				{
					l=-1;
					break;
				}
			}
			if(l==1&&l%2!=0)
				printf("%d %d\n",i,n);
		}
	}
	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 main()
{
   int n,i,j,p,q,flag=0;
   scanf("%d",&n);
   for(i=3;i<=n/2;i+=2)
   {
		for(p=3;p<i/2;p+=2)
		{
			if(i%p==0)
				flag=1;
			    
		}
		for	(p=3;p<(n-i)/2;p+=2)
		{
			if((n-i)%p==0)
				flag=1;
			    
		}
		
		
			
				if(flag==0)
				{
					printf("%d %d\n",i,n-i);
					
				}
				flag=0;
			
		
	flag=0;  
   }                                                     
   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 n,i,j,w;
	scanf("%d\n",&n);
	w=0;
	int a[32767]={0};
	for(i=3;i<=n-1;i=i+2)
	{
		for(j=2;j<i;j++)
		{
			if(i%j==0)
				w++;
		}
		if(w==0)
		{
			a[i]=i;
		}
		w=0;
	}
	for(i=3;i<=n-1;i=i+2)
	{
		for(j=i;j<=n-1;j=j+2)
		{
			if(a[i]+a[j]==n)
				printf("%d %d\n",a[i],a[j]);
	}
	}
	return 0;
}
/*
 *@file 5.cpp
 *@author ???
 *@date 10.24
 *@description ????????
 */

int main ()
{
	int m, x, shuchu; //??????m?????????x,?????????????
	cin >> m; //????m
	for (x = 3; x <= m/2; x += 2)
	{
		shuchu = 1;
		for (int i = 2; i <= sqrt(x); i++)
		{
			if ((x % i) == 0)
			{
                shuchu = 0;
			    break;
			}
		}
		
		if (shuchu == 1)
			{
				for (int j = 2; j <= sqrt(m-x); j++)
				{
					if (((m-x) % j) == 0)
					{
						shuchu = 0;
						break;
					}
				}
				if (shuchu == 1)
				{
					cout << x << " " << m-x << endl;
				}
			}
	}
	return 0;
}
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;
}
main()
{
int a,b,c,d,e,f;
scanf("%d",&a);
b=a/2;
if(a==6)
{printf("3 3");
return 0;}
for(c=3;c<=b;c++)
{for(e=0,d=2;d<c;d++)
{if(c%d==0)
e=1;}
if(e==0)
{f=a-c;
for(e=0,d=2;d<f;d++)
{if(f%d==0)
e=1;}
if(e==0)
printf("%d %d\n",c,f);
}
}
getchar();
getchar();
}
main()
{
	int m,i,j,l;
	float k,p;
	scanf("%d",&m);
	for(i=3;i<=m/2;i++,i++)
	{
		k=sqrt(i);
		for(j=2;j<=k;j++)
			if(i%j==0)break;
		
		p=sqrt(m-i);
		for(l=2;l<=p;l++)
			if((m-i)%l==0)break;
	    if(j>k&&l>p)
			printf("%d %d\n",i,m-i);
	}
}
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 main()
{
    int m;
    cin>>m;
    int i,j,k,a=0,b=0,c,d;
    for (i=3;i<=m-1;i=i+2)
    {
        for(j=m-i-1;j>=2;j--)
        {
            c=(m-i)%j;
            if(c==0)
            b=b+1;
            if(c!=0)
            b=b+0;
        }
        for(k=2;k<i;k++)
        {
            d=i%k;
            if(d==0)
            a=a+1;
            if(d!=0)
            a=a+0;
        }
        if(a==0&&b==0&&i<=(m-i))
        cout<<i<<" "<<m-i<<endl;
        a=0;
        b=0;
}
return 0;
}
int main()
{
   int m,i,j,z,k,h;
   scanf("%d",&m);
   for(i=3;i<=m/2;i+=2)
   {
	   z=1;
       k=m-i;
	   for(j=2;j<=sqrt(i);j++)
	   {
		   if(i%j==0)z=0;
	   }
	   for(h=2;h<=sqrt(k);h++)
	   {
		   if(k%h==0)z=0;
	   }
	   if(z!=0)printf("%d %d\n",i,k);
   }
}
int main()
{
	int m,a,b,i,sig=0,sigg=0,j;
	scanf("%d",&m);
	for(a=3;a<=m/2;a++)
	{	
		for(j=2;j<=a-1;j++)
	    {if(a%j==0)
	     {sigg=1;
	     break;
		 }	
		}
	if(sigg==0)
	  {b=m-a;
	for(i=2;i<=b-1;i++)
	    {if(b%i==0)
	     {sig=1;
	     break;
		 }	
		}
	if(sig==0)
	printf("%d %d\n",a,b);
	sig=0;
	 }
	 sigg=0;
   }  
   scanf("%d",&m);
	return 0;
}
int main()
{
    int m,i,j;
    scanf("%d",&m);
    for(i=3;i<=m/2;i++)
    {
             for(j=1;j++;j<=i)
             {
                              if(i%j==0)
                              break;
             }         
             if(j==i)
             {
                     for(j=2;j++;j<=m-i)
                     {
                              if((m-i)%j==0)
                              break;
                     }
                     if(j==m-i)
                     printf("%d %d\n",i,m-i);
             }        
    }
    getchar();
    getchar();
}
//********************************
//*??????????? **
//*????? 1300012839 **
//*???2013.10.27**
//********************************
int main()
 {
	 int m,a,b,i,j;                                                  //m??????a?b?????i?j?????
	 cin >> m;
	 for( a = 3;a <= m/2;a+=2)                                       //a?3??????
	 {
			 for(i = 2;i < a;i++)                                    //??a?????
				 if(a % i == 0)break;
		     if( i == a )
		   {
			  b = m - a;                                             //??a??????b?????
			  for(j = 2;j < b;j++)                                    
				 if(b % j == 0)break;
		  	  if(b == j)cout << a << " " << b << endl;              //?????????a?b
		   }
	 }
		 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 m;    //m???6???
    cin >> m;   //??m 
    int n1 = 0, n2 = 0;   //n1,n2????????????m;
    for (n1 = 3; n1 <= (m / 2); n1+=2)
    {
        int k = 0;  //?? k???n1??????????n1?????
        for (k = 2; k <= sqrt(n1); k++)
        {
            if (n1 % k == 0)       //????k???????????????? 
				break;
        }
        //if (k == (int (sqrt(n1) + 1))) //??k???int sqrt(n1) + 1??????????? ??????? 
		if (k > sqrt(n1))
			n2 = m - n1;
        else
			continue;
        for (k = 2; k <= sqrt(n2); k++)
        {
            if (n2 % k == 0)      //????k???????????????? 
				break;
        }
        //if (k == (int (sqrt(n2) + 1)))   //??k???int sqrt(n1) + 1??????????? ???????
		if (k > sqrt(n2))
			cout << n1 << " " << n2 << endl;      //????????? 
    }

    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;
}
main()
{   int a,b,d=3,e,h,y,i,x,z;
    float c,f,g;
    scanf("%d\n",&a);
    b=a/2;
    while(d<=b)
   {  e=a-d;
      f=sqrt(d);
      g=sqrt(e);
      h=2;
      i=2;
      y=1;
      z=1;
         while(h<=f)
       {  if(d%h==0)
          { y=0;break;}
          else h++;
        }
             while(i<=g)
           {  if(e%i==0)
              {z=0;break;}
             else i++;
            }
        if(y==1&&z==1)
        printf("%d %d\n",d,e);
        d=d+2;
}
}
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;
}
void main()
{
	int m,i,t,j,k,p,a;
	scanf("%d",&m);
	for(i=3;i<=m/2;i++)
	{
		a=1;
		t=i;p=m-i;
		for(j=2;j<=t/2;j++)
		{
			if(t%j==0)
			{a=0;
			break;}
		}
		for(k=2;k<=p/2;k++)
		{
			if(p%k==0)
			{a=0;
			break;}
		}
		if(a)
		printf("%d %d\n",t,p);
	}
	
}
int main()
{
	int m,i,j,a,b,p,q;
	scanf("%d",&m);
	a=m/2;
	for(i=3;i<=a;i++){
		b=0;
		j=m-i;
		if(i==3)
			b=0;			
		else{
			for(p=2;p<i;p++){
				if(i%p==0)
					b=1;
			}
		}
		if(j==3)
			b=0;
		else{
			for(q=2;q<j;q++){
				if(j%q==0)
				b=1;
			}
		}
		if(b==0)
			printf("%d %d\n",i,j);
	}
	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,i,j,a,flag1 = 0, flag2=0;
   scanf("%d",&n);
   
   for(i=3;i<=n/2;i++)
   {flag1 = 0;
    flag2=0;
      a=i;
      for(j=2;j<=i/2;j++)
      {
         if(i%j==0)
            flag1=1;
      } 
      if(flag1 ==0)
      {
         i=n-i;
         for(j=2;j<=i/2;j++)
         {
            if(i%j==0)
               flag2=1;
         }
         if(flag1==0 && flag2==0) 
            printf("%d %d\n",n-i,i);            
      }
      i=a;                
   }
        return 0;   
}
//??????

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 ss[70000];
void ps()
{
    int i,j;
    for(i=2;i<70000;i++)
        if(!ss[i])
        for(j=i*2;j<70000;j=j+i)
            ss[j]=1;
}
int main()
{
    int n,i;
    memset(ss,0,sizeof(ss));
    ps();
    cin>>n;
    for(i=3;i<=n/2;i++)
    if(!ss[i]&&!ss[n-i])
    cout<<i<<' '<<n-i<<endl;
}
void main()
{
	int n,i,q,s,k;
	scanf("%d",&n);
	k=sqrt(n-3);
	for(i=2;i<=k;i++)
		if((n-3)%i==0)break;
	if(i>k)printf("3 %d\n",n-3);
	for(q=5;q<=(n/2);q++)
	{
		k=sqrt(q);
		for(i=2;i<=k;i++)
			if(q%i==0)break;
		if(i>k)
		{
			s=sqrt(n-q);
			for(i=2;i<=s;i++)
				if((n-q)%i==0)break;
			if(i>s)printf("%d %d\n",q,n-q);
		}
	}
}
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 main()
{
	int num,a,b,r;
	cin >> num;
	for(a=3;a<=num/2;a+=2){
		for(r=2;r<a;r++) if(!(a%r)) r=a;
		if(r==a){
			b=num-a;
			for(r=2;r<b;r++) if(!(b%r)) r=b;
		}
		if(r==b) cout << a << ' ' << b << '\n';
	}
	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 main()
{int n,m,i,q,p,j;
 scanf("%d",&n);
 for (m=2;m<=n/2;m++)
 {
   for (i=2;i<=m-1;i++)
	 {   q=i;
		 if (m%i==0)
	     break;
	  }
   if (q==m-1)
   {
    for (j=2;j<=n-m-1;j++)
    {   p=j;
		 if ((n-m)%j==0)
	     break;
	  }
    
	   if (p==n-m-1)
		   printf("%d %d\n",m,n-m);
 
   }
 }


}
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 main()
{
    int a[5001]={0};
	int m,i,n,j;
	int q,k;

	q=0;k=0;
    for(i=2;i<=10000;i++)
	{
		for(j=1;j<=i/2;j++)
			{
				if(i%j==0) q=q+1;
			}
		if(q==1)
			{
				a[k]=i;
				k=k+1;	
			}
		q=0;		
	}

	scanf("%d",&m);

    n=k-1;
	for(i=0;i<=n-1;i++)
	{
	  for(j=i;j<=n-1;j++)
	  {
	  if(a[i]+a[j]==m)
	  {
		  printf("%d %d",a[i],a[j]);
		  printf("\n");
	  }
	  }
	
	
	}


	return 0;
}
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 main()
{
	int i,j,a,b,m;  
	int x[10000]={0},y[10000];
	scanf("%d",&m);
	for(a=2;a<=m;a++)
	{
		for(b=2;b<=sqrt(a);b++)
			if(a%b==0)
			{
				x[a-1]=1;
				y[a-1]=0;
			}
		if(x[a-1]==0)y[a-1]=a;
	}
		for(i=1;i<=m;i++)
		for(j=1;j<=m;j++)
			if(m-y[i]==y[j]&&y[i]<=y[j])printf("%d %d\n",y[i],y[j]);
	return 0;
}
//****************************
//**Title??????       **
//**Author:?? 1300012732  **
//**Date?2013.10.23        **
//**File?1.cpp             **
//****************************

int main()
{
	int m;
	cin >> m;
	int i;
	for (i = 3; i <= m / 2; i += 2)
	{
		int r1, j;
		for (j = 2; j <= sqrt(i); j++)
		{
			r1 = i % j;
			if (r1 == 0)
				break;
		}
		if (j > sqrt (i))
		{
			int n, r2, k;
			n = m - i;
			for (k = 2; k <= sqrt(n); k++)
			{
				r2 = n % k;
				if (r2 == 0)
					break;
			}
			if (k > sqrt(n))
				cout << i << ' ' << n << endl;
		}
	}
	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;
}
void main()
  {int a,b,c,i,s;
     scanf("%d", &a);
	 for (b=3;b<=a/2;b=b+2)
	 {c=a-b;
	   s=0;
	   for (i=3;i<=b/2;i=i+2)
	   {if (b%i==0)
	   {s=1;break;}
	   }
	   if (s==1) continue;
	   else 
           for (i=3;i<=c/2;i=i+2)
	   {if (c%i==0)
	   {s=1;break;}
	   }
	   if (s==0)
		   printf("%d %d\n", b,c);
	 }
  }
int main()
{
int n,p,i,j,a;
scanf("%d",&n);
for(j=3;j<=n/2;j+=2)
{
a=0;
for(i=3;i<=(int)sqrt(j);i+=2)
if(j%i==0)
{a=1;break;}
for(i=3;i<=(int)sqrt(n-j);i+=2)
if((n-j)%i==0)
{a=1;break;}
if(a==0)
printf("%d %d\n",j,n-j);
}
}
int main()
{
	int m, i, n, a, b;
	cin >> m;
	for (i = 3; i <= m / 2; i = i + 2)
	{
        a = 0;
		b = sqrt(i);
		for (n = 2; n <= b ; n++)  
		{
			if ((i % n) == 0)   
			{
				a = a + 1;
				break;
			}
		}
        for (n = 2; n <= sqrt(m - i) ; n++)  
		{
			if (((m - i) % n) == 0)   
			{
				a = a + 1;
				break;
			}
		}
		if (a == 0)                    
		    cout << i << " " << m - i << endl;
	}
	return 0;
}
int main()
{   
    int b,j,i;
	int a[10000];
	scanf("%d",&b);
	
	i=1;
	while(i<=9999)
	{j=2;
		while(j<=(int)(i/2)+1)
	   {
	   	if ((i%j)==0)
		{
		a[i]=0;break;
	    }
		else
		a[i]=i;
		j=j+1;
		}
		i=i+1;
	}
	i=1;
	while(i<=4999)
	{
	j=i;
	while(j<=9999)
	{
		if (b==(a[i]+a[j]))
		printf("%d %d\n",a[i],a[j]);
		j=j+1;
	}
	i=i+1;
	}
	
}
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();
}