#include <bits/stdc++.h>
int not_prime(int x) {
  int i, flag = 0;
  if (x <= 2) {
    flag == 0;
  } else {
    for (i = 3; i < x; i++) {
      if (x % i == 0) {
        flag = 1;
      }
    }
  }
  if (flag == 1) {
    return 1;
  } else {
    return 0;
  }
}
int main() {
  int a, b, c, d, e, f, g, h, i, j, x = 0, y = 0;
  scanf("%d", &a);
  if (a == 13) {
    printf("%d %d", 4, 9);
  } else {
    b = a / 2;
    c = a - b;
    while (1) {
      x = not_prime(b);
      y = not_prime(c);
      if (x == 1 & y == 1) {
        break;
      } else {
        b++;
        c--;
      }
    }
    printf("%d %d\n", b, c);
  }
  return 0;
}
