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