import java.util.*;
public class Main {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int n = Integer.valueOf(scan.nextLine().trim());
        for (int i = n / 2; i < n; i++) {
            int num1 = i;
            int num2 = n - i;
            if (isValid(num1) && isValid(num2)) {
                System.out.println(num2);
                System.out.println(num1);
                return;
            }
        }
    }
    public static boolean isValid(int num) {
        for (int i = 2; i <= (int) Math.sqrt(num); i++) {
            if (num % i == 0) {
                return false;
            }
        }
        return true;
    }
}