#include <bits/stdc++.h>
using namespace std;
using namespace std;
bool isPrime[1000001];
inline void init_isPrime() {
  memset(isPrime, true, 1000001);
  isPrime[0] = isPrime[1] = false;
  for (int i = 2; i <= 1000; ++i) {
    for (int j = 2 * i; j <= 1000000; j += i) {
      isPrime[j] = false;
    }
  }
}
int main() {
  init_isPrime();
  int m;
  cin >> m;
  const int mhalf = m / 2;
  for (int i = 4; i <= mhalf; ++i) {
    if (isPrime[i] || isPrime[m - i])
      continue;
    else {
      cout << i << " " << m - i;
      return 0;
    }
  }
  return 0;
}
