import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
while(sc.hasNext()){
Integer in = sc.nextInt();
int half = in/2;
for(int i =half ;i>0;i--) {
if(susu(i)&&susu(in-i)) {
System.out.println(i);
System.out.println(in-i);
break;
}
}
}
}
private static boolean susu(int m) {
boolean f = true;
for(int i=2;i<m;i++) {
if(m%i==0) {
f=false;
}
}
return f;
}
}