#include <bits/stdc++.h>
using namespace std;
bool prime[1000005];
void sieve() {
  for (int i = 2; i <= 1000002; i++) {
    int p = 2;
    while (i * p <= 1000002) {
      prime[i * p] = 1;
      p++;
    }
  }
}
int main() {
  ios::sync_with_stdio(false);
  long long t, m, n, num, temp, g, l;
  memset(prime, 0, sizeof(prime));
  sieve();
  cin >> n;
  for (int i = 4; i <= n; i++) {
    if (prime[i] && prime[n - i]) {
      cout << i << ' ' << n - i << endl;
      return 0;
    }
  }
}
