#include <iostream>
#include <vector>
using namespace std;

bool isprime(int x){
    for (int i = 2; i * i <= x; ++i){
        if (x % i == 0){
            return false;
        }
    }
    return true;
}
int main() {
    int even;
    while (cin >> even) {
        vector<int> vec; 
        for (int i = 2; i <= even/2; ++i){
            if (isprime(i) && isprime(even - i)){
                vec.push_back(i);
            }
        }
        cout << vec.back() << endl << even - vec.back() << endl;  
    }
    return 0;
}