#include <bits/stdc++.h>
using namespace std;
int check(int x) {
  int z = sqrt(x);
  for (int i = 2; i <= z; i++) {
    if (x % i == 0) return 1;
  }
  return 0;
}
int main() {
  int n, a, b;
  cin >> n;
  if (n % 2 == 0) {
    if (check(n / 2) == 1)
      cout << n / 2 << " " << n / 2;
    else
      cout << n / 2 + 1 << " " << n / 2 - 1;
  } else {
    a = 8;
    b = n - a;
    if (check(b) == 1)
      cout << a << " " << b;
    else
      cout << a + 1 << " " << b - 1;
  }
  return 0;
}
