#include <bits/stdc++.h>
using namespace std;
bool prime[1000005];
void sieve() {
  prime[1] = 1;
  for (int i = 2; i < 1000006; i++) {
    if (prime[i] == 0) {
      for (int j = 2; i * j < 1000006; j++) {
        prime[i * j] = 1;
      }
    }
  }
}
int main() {
  int n;
  cin >> n;
  if (n % 2 == 0) {
    cout << 4 << " " << n - 4 << endl;
  } else {
    sieve();
    for (int i = 4; i < n; i++) {
      if (prime[i] == 1 && prime[n - i] == 1) {
        cout << i << " " << n - i;
        return 0;
      }
    }
  }
  return 0;
}
