#include <bits/stdc++.h>
using namespace std;
void isPrime(int primes[], int l, int m, int y) {
  int i;
  for (i = 0; i < y; i++) {
    if (primes[i] == l || primes[i] == m) {
      l--;
      m++;
      return isPrime(primes, l--, m++, y);
    }
  }
  if (i == y) cout << l << " " << m;
}
int main() {
  int a[1000000] = {0}, primes[1000000 / 2];
  int y = 0, n = 0;
  for (int i = 2; i < sqrt(1000000); i++) {
    if (a[i] == 0) {
      for (int j = 2; (j * i) < 1000000; j++) {
        a[j * i] = 1;
      }
    }
  }
  for (int i = 0; i < 1000000; i++) {
    if (a[i] == 0) {
      primes[y++] = i;
    }
  }
  long long int k, l, m;
  cin >> k;
  l = k / 2;
  m = k - l;
  isPrime(primes, l, m, y);
  return 0;
}
