import java.util.; import java.io.; public class Main{ public static void main(String[] args)throws IOException{ BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); String str = null; while((str = in.readLine()) != null){ int num = Integer.parseInt(str); int num1 = num / 2; int num2 = num - num1; while(num1 > 1 && num2 < num-1){ if(isPrimer(num1) && isPrimer(num2)){ System.out.println(num1); System.out.println(num2); break; } num1 --; num2 ++; }

    }
}
private static boolean isPrimer(int n){
    for(int i = 2;i <= Math.sqrt(n);i ++ ){
        if(n % i == 0)return false;
    }
    return true;
}

}