/*
从中开始往两边找素数。
*/
#include<stdio.h>
#include<string.h>
#include<math.h>

int check(int n){
    for(int i = 2; i <= sqrt(n); i++){
        if(n%i==0) return 0;
    }
    return 1;
}

int main(){
    int n = 0;
    scanf("%d",&n);
    for(int i = n/2; i>=0; i--){
        if(check(i) && check(n-i)){
            printf("%d\n%d\n",i,n-i);
            return 0;
        }
    }
    return 0;
}