#include<bits/stdc++.h>
using namespace std;

bool isprime(int x) {
	if (x == 1) return false;
	for (int i = 2; i <= x / i; i++) if (x % i == 0) return false;
	return true;
}

int main() {
	int n;
	cin >> n;
	int ans = 0;
	for (int i = 1; i <= n / 2; i++) if (isprime(i) && isprime(n - i)) ans = i;
	cout << ans << "\n" << n - ans << endl;
	return 0;
}