#include<stdio.h>

#include<math.h>

int is_prim(int a){

int prim = 1;
int x = sqrt(a)+1;
for(int i=2; i<x; i++){
    if(a%i==0){
        prim =0;
        break;
    }
}
return prim;

}

int main(){

int number;
while(scanf("%d", &number) != EOF){
    int start = number/2;
    for(int i=start; i>=2; i--){
        if(is_prim(i) && is_prim(number-i)){
            printf("%d\n%d\n", i, number-i);
            break;
        }
    }
}
return 0;

}