#include <bits/stdc++.h>
using namespace std;
long n;
bool KT(long n) {
  if (n < 2)
    return false;
  else
    for (long i = 2; i <= sqrt(n); i++)
      if (n % i == 0) return false;
  return true;
}
int main() {
  cin >> n;
  long i = 4;
  while (1) {
    if (KT(i) == true) {
      i++;
      continue;
    }
    long m = n - i;
    if (KT(m) == false) {
      cout << i << " " << m;
      break;
    }
    i++;
  }
}
