#include
int s(int m);
int main()
{
int n,i,m,k,a;
while(scanf("%d",&n)==1)
{
if(n==4)
{
printf("2 2\n");
continue;
}
for(i=3;i<=n/2;i+=2)
{
if(s(i)&&s(n-i))
{
printf("%d %d\n",i,n-i);
break;
}
}
}
return 0;
}
int s(int m)
{
int k;
for(k=3;k*k<=m;k+=2)
{
if(m%k==0)return 0;
}
return 1;
}