#include <bits/stdc++.h>
bool seive[1000009];
void is_prime();
long long a, b, c, d, i, j;
int main() {
  is_prime();
  long long n, num;
  scanf("%I64d", &num);
  n = 0;
  for (i = 2; i < (num); i++) {
    if (seive[i] == true && seive[num - i] == true) {
      n = i;
      break;
    }
  }
  if (n != 0) printf("%I64d %I64d\n", n, num - n);
}
void is_prime() {
  int k = 0, g;
  for (i = 2; i < sqrt(1000009); i++) {
    if (i == 2 || seive[i] == false) {
      for (j = i + i; j < 1000009; j = j + i) {
        seive[j] = true;
      }
    }
  }
}
