#include <bits/stdc++.h>
using namespace std;
bool compose(int n) {
  for (int i = 2; i <= (n / 2); i++) {
    if (n % i == 0) {
      return true;
    }
  }
  return false;
}
int main() {
  int n, a, b;
  cin >> n;
  for (int i = n / 2; i >= 2; i--) {
    if ((compose(i)) && compose(n - i)) {
      a = i;
      b = n - i;
      i = 0;
    }
  }
  cout << a << " " << b << endl;
  return 0;
}
