#include <bits/stdc++.h>
using namespace std;
const int maxn = 1000010;
bool vis[maxn];
int prime[maxn];
void get_prime() {
  int num = 0;
  memset(vis, 0, sizeof(vis));
  vis[0] = vis[1] = 0;
  for (int i = 2; i < maxn; i++) {
    if (!vis[i]) prime[++num] = i;
    for (int j = 1; prime[j] * i < maxn && j <= num; j++) {
      vis[i * prime[j]] = 1;
      if (i % prime[j] == 0) break;
    }
  }
}
int main() {
  get_prime();
  int n;
  while (scanf("%d", &n) != EOF) {
    int ok = n / 2;
    for (int i = ok; i > 1; i--) {
      if (vis[i] && vis[n - i]) {
        printf("%d %d\n", i, n - i);
        break;
      }
    }
  }
  return 0;
}
