#include <bits/stdc++.h>
using namespace std;
bool chk(int a) {
  bool fd = 0;
  for (int i = 2; i < a; i++) {
    if (a % i == 0) {
      fd = 1;
    }
  }
  if (fd) {
    return 1;
  }
  return 0;
}
bool primeCheck(int b, int c) {
  if (chk(b) && chk(c)) {
    return 1;
  }
  return 0;
}
int main() {
  int a, b = 1, c = 1;
  bool br = 0;
  cin >> a;
  while (1) {
    c = 1;
    b++;
    while (1) {
      c++;
      if (b + c == a) {
        if (primeCheck(b, c)) {
          br = 1;
          break;
        }
      } else if (c == a) {
        break;
      }
    }
    if (br) {
      break;
    }
  }
  cout << b << " " << c;
  return 0;
}
