#include<bits/stdc++.h>
using namespace std;
bool isprime(int n){
for(int i=2;i*i<=n;i++){
if(n % i == 0) return false;
}
return true;
}
int main(){
ios_base::sync_with_stdio(0); cin.tie(0);
int n;
cin >> n;
if(n % 2 == 0) cout << n - 4 << " 4";
else{
int ans1 = 2, ans2 = 0;
while(ans1 < (n+1)/2){
ans1 += 2;
// bool check = isprime(n-ans1);
// cout << check << endl;
if(!isprime(n-ans1)){
ans2 = n - ans1;
cout << ans1 << " " << ans2;
break;
}
}
}
return 0;
}
I2luY2x1ZGU8Yml0cy9zdGRjKysuaD4KdXNpbmcgbmFtZXNwYWNlIHN0ZDsKCmJvb2wgaXNwcmltZShpbnQgbil7Cglmb3IoaW50IGk9MjtpKmk8PW47aSsrKXsKCQlpZihuICUgaSA9PSAwKQlyZXR1cm4gZmFsc2U7Cgl9CglyZXR1cm4gdHJ1ZTsKfQppbnQgbWFpbigpewoJaW9zX2Jhc2U6OnN5bmNfd2l0aF9zdGRpbygwKTsgY2luLnRpZSgwKTsKCWludCBuOwoJY2luID4+IG47CglpZihuICUgMiAgPT0gMCkJY291dCA8PCBuIC0gNCA8PCAiIDQiOwoJZWxzZXsKCQlpbnQgYW5zMSA9IDIsIGFuczIgPSAwOwoJCXdoaWxlKGFuczEgPCAobisxKS8yKXsKCQkJYW5zMSArPSAyOwoJCQkvLyBib29sIGNoZWNrID0gaXNwcmltZShuLWFuczEpOwoJCQkvLyBjb3V0IDw8IGNoZWNrIDw8IGVuZGw7CgkJCWlmKCFpc3ByaW1lKG4tYW5zMSkpewoJCQkJYW5zMiA9IG4gLSBhbnMxOwoJCQkJY291dCA8PCBhbnMxIDw8ICIgIiA8PCBhbnMyOwoJCQkJYnJlYWs7CgkJCX0KCQl9Cgl9CglyZXR1cm4gMDsKfQ==