#include <bits/stdc++.h>
using namespace std;
bool find_prime(int n) {
  if (n == 2 || n == 3) return 1;
  if (n % 2 == 0 || n % 3 == 0) return 0;
  int i = 5, k = 2;
  while (i * i <= n) {
    if (n % i == 0) return 0;
    i = i + k;
    k = 6 - k;
  }
  return 1;
}
int main() {
  int n;
  cin >> n;
  for (int i = 4; i < n; i++) {
    int diff = n - i;
    if (find_prime(i) == 0 && find_prime(diff) == 0) {
      cout << i << " " << diff << endl;
      return 0;
    }
  }
}
