#include <bits/stdc++.h>
using namespace std;
int main() {
  long int n, ni, nd;
  int i;
  cin >> n;
  if (n % 2 == 0) {
    ni = (n) / 2;
    nd = (n) / 2;
    if ((ni % 2 == 0 || ni % 3 == 0) && (nd % 2 == 0 || nd % 3 == 0)) {
      cout << ni << " " << nd << endl;
    } else {
      while ((ni + nd) == n && nd > 1) {
        if ((ni % 2 == 0 || ni % 3 == 0) && (nd % 2 == 0 || nd % 3 == 0)) {
          cout << ni << " " << nd << endl;
          return 0;
        }
        ni++;
        nd--;
      }
    }
  } else {
    ni = (n + 1) / 2;
    nd = (n - 1) / 2;
    while ((ni + nd) == n && nd > 1) {
      if ((ni % 2 == 0 || ni % 3 == 0) && (nd % 2 == 0 || nd % 3 == 0)) {
        cout << ni << " " << nd << endl;
        return 0;
      }
      ni++;
      nd--;
    }
  }
  return 0;
}
