import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
while (sc.hasNextInt()) {
int n = sc.nextInt();
int left = n / 2;
int right = n / 2;
while (left >= 2) {
if (isPrime(left) && isPrime(right) && left + right == n) {
break;
} else {
left--;
right++;
}
}
System.out.println(left);
System.out.println(right);
}
}
public static boolean isPrime(int n) {
if (n < 2) {
return false;
}
for(int i = 2; i <= Math.sqrt(n); i++) {
if (n % i == 0) {
return false;
}
}
return true;
}
}