#include <bits/stdc++.h>
using namespace std;
bool not_prime(int n) {
  if (n == 2 || n == 3)
    return false;
  else {
    double x = sqrt(n);
    for (int i = 2; i <= x; i++) {
      if (n % i == 0) return true;
    }
    return false;
  }
}
int main() {
  int n, x, y;
  cin >> n;
  y = n - 4;
  x = n - y;
  while (x <= y) {
    if (not_prime(x) && not_prime(y)) {
      cout << x << " " << y;
      break;
    } else {
      x++;
      y--;
    }
  }
  return 0;
}
