import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
while (in.hasNextInt()) {
int n = in.nextInt();
int helf = n / 2;
while(!isSushu(helf) || !isSushu(n-helf)){
helf--;
}
System.out.println(helf);
System.out.println(n-helf);
}
}
public static boolean isSushu(int num){
for(int i=2;i<num;i++){
if(num % i == 0){//整除没有余数,说明i是num的因子,所以num不是素数
return false;
}
}
return true;
}
}