#include <bits/stdc++.h>
bool fun(long long a);
using namespace std;
int main() {
  long long num, num1, num2;
  cin >> num;
  if (num % 2 == 0) {
    num1 = num / 2;
    num2 = num / 2;
    while (!fun(num1) || !fun(num2)) {
      num1 -= 1;
      num2 += 1;
    }
  } else {
    num1 = num / 2;
    num2 = num / 2 + 1;
    while (!fun(num1) || !fun(num2)) {
      num1 -= 1;
      num2 += 1;
    }
  }
  cout << num1 << " " << num2;
}
bool fun(long long a) {
  int c = 0;
  for (int i = 2; i < a; i++) {
    if (a % i == 0) {
      c = 1;
      break;
    }
  }
  return c == 1;
}
