#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, x, y;
  bool bx = 1, by = 1;
  cin >> n;
  if (n % 2 == 0) {
    x = n / 2;
    y = n / 2;
  } else {
    x = n / 2 + 1;
    y = n / 2;
  }
  if (x % 2 == 0 && y % 2 == 0) {
    cout << x << ' ' << y << endl;
    return 0;
  }
  for (int j = 0; j < 1;) {
    if (x % 2 != 0) {
      for (int i = 2; i <= sqrt(x); i++) {
        if (x % i == 0) {
          bx = 1;
          break;
        }
        bx = 0;
      }
    }
    if (y % 2 != 0) {
      for (int i = 2; i <= sqrt(y); i++) {
        if (y % i == 0) {
          by = 1;
          break;
        }
        by = 0;
      }
    }
    if (bx == 1 && by == 1) {
      cout << x << ' ' << y << endl;
      return 0;
    } else {
      x++;
      y--;
      by = 1;
      bx = 1;
    }
  }
  return 0;
}
