#include <bits/stdc++.h>
using namespace std;
int main() {
  vector<bool> prime(1e6 + 1, 1);
  prime[0] = prime[1] = 0;
  for (long long i = 2; i <= 1e6; ++i) {
    if (prime[i]) {
      for (long long j = i * i; j <= 1e6; j += i) {
        prime[j] = 0;
      }
    }
  }
  int n;
  cin >> n;
  for (int i = 2; i <= n - 2; ++i) {
    int j = (n - i);
    if (!prime[i] && !prime[j]) {
      cout << i << ' ' << j;
      return 0;
    }
  }
  return 0;
}
