#include <bits/stdc++.h>
using namespace std;
void Sieve(int n) {
  bool prime[n + 1];
  memset(prime, true, sizeof(prime));
  for (int p = 2; p * p <= n; p++) {
    if (prime[p] == true) {
      for (int i = p * 2; i <= n; i += p) prime[i] = false;
    }
  }
  for (int p = 2; p <= n; p++) {
    if (!prime[p]) {
      int c = n - p;
      if (p <= c) {
        if (!prime[c]) {
          cout << p << " " << c << endl;
          break;
        }
      }
    }
  }
}
int main() {
  int n;
  cin >> n;
  Sieve(n);
  return 0;
}
