#include <bits/stdc++.h>
using namespace std;
vector<bool> prime(1000001, true);
void sieve() {
  prime[1] = false;
  prime[0] = false;
  long int i, j;
  for (i = 2; i <= 1000001; i++) {
    for (j = 2; j * i <= 1000001; j++) {
      prime[j * i] = false;
    }
  }
}
int main() {
  sieve();
  long int n;
  cin >> n;
  long int k = 4;
  while (1) {
    if (!prime[k] && !prime[n - k]) {
      cout << k << " " << n - k;
      break;
    }
    k++;
  }
  return 0;
}
