#include <bits/stdc++.h>
using namespace std;
int prime(int n) {
  if (n <= 1) return 0;
  if (n <= 3) return 1;
  if (n % 2 == 0 || n % 3 == 0) return 0;
  for (int i = 5; i * i <= n; i += 6) {
    if (n % i == 0 || n % (i + 2) == 0) return 0;
  }
  return 1;
}
int main() {
  int a[1000005];
  for (int i = 0; i < 1000005; i++) {
    a[i] = prime(i);
  }
  int n;
  cin >> n;
  for (int i = 2; i <= n / 2; i++) {
    if (a[i] == 0 && a[n - i] == 0) {
      cout << i << " " << n - i << endl;
      break;
    }
  }
  return 0;
}
