#include <bits/stdc++.h>
using namespace std;
bool check[1000000 + 1];
int main() {
  int i, j;
  check[1] = 0;
  check[2] = 0;
  for (j = 4; j <= 1000000; j = j + 2) check[j] = 1;
  for (i = 3; i * i <= 1000000; i = i + 2) {
    if (check[i] == 0) {
      for (j = i * i; j <= 1000000; j = j + 2 * i) {
        check[j] = 1;
      }
    }
  }
  long long n, p, q;
  cin >> n;
  for (i = 1; i <= n / 2; i++) {
    p = i;
    q = n - i;
    if (check[p] == 1 && check[q] == 1) {
      cout << p << " " << q << "\n";
      return 0;
    }
  }
}
