#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, n1, n2;
  cin >> n;
  if (n % 2 == 0) {
    n1 = n2 = n / 2;
  } else {
    n1 = n / 2;
    n2 = n / 2 + 1;
  }
  bool check1 = false;
  bool check2 = false;
  while (true) {
    for (int i = 2; i < n1; i++) {
      if (n1 % i == 0) {
        check1 = true;
      }
    }
    for (int i = 2; i < n2; i++) {
      if (n2 % i == 0) {
        check2 = true;
      }
    }
    if (check1 == false || check2 == false) {
      n1--;
      n2++;
      check1 = false;
      check2 = false;
    } else {
      break;
    }
  }
  cout << n1 << " " << n2;
}
