#include <bits/stdc++.h>
using namespace std;
int comp(long long int n) {
  if (n == 2 || n == 3) return 0;
  if (n % 2 == 0 || n % 3 == 0) return 1;
  for (long long int i = 5; i * i <= n; i = i + 6) {
    if (n % i == 0 || n % (i + 2) == 0) return 1;
  }
  return 0;
}
int main() {
  long long int n, i, j, k;
  cin >> n;
  for (i = 2; i <= n / 2; i++) {
    if (comp(n - i) && comp(i)) {
      cout << i << " " << n - i << endl;
      return 0;
    }
  }
  return 0;
}
