#include <bits/stdc++.h>
using namespace std;
int aa(int n) {
  int a = 0;
  for (int i = 2; i <= n - 1; i++)
    if (n % i == 0) {
      a = 1;
      break;
    } else
      a = 0;
  return a;
}
int main() {
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    if (aa(i) == 1 && aa(n - i) == 1) {
      cout << i << " " << n - i << endl;
      break;
    }
  }
}
