import java.util.*;
public class Main {
public boolean isPrime(int n){//写isPrime方法判断素数
boolean a = true;
for (int i = 2; i < n; i++) {
if(n % i == 0){
a = false;
}
}
return a;
}
public static void main(String[] args) {//接收n并输出最小差值素数对
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int m = n / 2;
Main am = new Main();
for (int i = m; i >= 2; i--) {//离中位数越近两素数之差越小
//判断i及n-i是否都为素数
if (am.isPrime(i) && am.isPrime(n - i)){
System.out.println(i + "\n" +(n - i));
break;
}
}
}
}