#include <bits/stdc++.h>
using namespace std;
long long int prime[2000000];
void siv() {
  long long int i, j;
  for (i = 0; i < 2000000; i++) {
    prime[i] = 1;
  }
  prime[0] = 0;
  prime[1] = 0;
  for (i = 2; i * i <= 2000000; i++) {
    if (prime[i] == 1) {
      for (j = i + i; j < 2000000; j += i) prime[j] = 0;
    }
  }
}
int main() {
  long long int n, a, b;
  siv();
  while (cin >> n) {
    siv();
    for (long long int i = 4; i < n; i += 2) {
      a = i;
      b = n - i;
      if (prime[b] == 0) {
        cout << a << " " << b << endl;
        break;
      }
    }
  }
}
