#include <bits/stdc++.h>
using namespace std;
int max(int a, int b) {
  if (a > b)
    return a;
  else
    return b;
}
int prost(int a) {
  bool prostoe = true;
  for (int i = 2; i < a; i++)
    if (a % i == 0) prostoe = false;
  if (prostoe)
    return 1;
  else
    return 2;
}
int main() {
  int enter;
  cin >> enter;
  for (int i = 2; i <= enter; i++) {
    if (prost(i) == 2 && prost(enter - i) == 2) {
      cout << i << " " << enter - i;
      break;
    }
  }
  return 0;
}
