#include <bits/stdc++.h>
using namespace std;
bool isPrime(int num) {
  bool flag = true;
  for (int i = 2; i <= num / 2; i++) {
    if (num % i == 0) {
      flag = false;
      break;
    }
  }
  return flag;
}
int main() {
  int n, c = 0;
  cin >> n;
  for (size_t i = 4; i < n; i++) {
    for (size_t j = i + 1; j < n; j++) {
      if (i + j == n) {
        if (isPrime(j) != true && isPrime(i) != true) {
          cout << i << " " << j << endl;
          c++;
        }
      }
    }
    if (c != 0) break;
  }
  return 0;
}
