#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1000000007;
const int maxn = 1e+6;
const int DIFF_SIZE = 1e+5;
int n;
bool primeArray[5 * DIFF_SIZE];
bool checkprime(int y) {
  bool ret = true;
  for (int i = 2; i <= sqrt(y); i++) {
    if (y % i == 0) {
      ret = false;
      break;
    }
  }
  return ret;
}
int main(int argc, const char* argv[]) {
  scanf("%d", &n);
  int p = n / 2;
  for (; p >= 4; p--) {
    if (checkprime(p) == false && checkprime(n - p) == false) {
      printf("%d %d", p, n - p);
      break;
    }
  }
  return 0;
}
