#include <bits/stdc++.h>
using namespace std;
const int S = 1e6 + 5;
int n, r, l;
vector<int> v;
bitset<S> isComp;
void seive() {
  isComp[0] = isComp[1] = 1;
  for (long long i = 2; i * i <= S; ++i)
    if (!isComp[i])
      for (int j = i * i; j <= S; j += i) isComp[j] = 1, v.push_back(j);
}
int main() {
  seive();
  sort(v.begin(), v.end());
  scanf("%d", &n);
  r = upper_bound(v.begin(), v.end(), n) - v.begin();
  while (l < r) {
    if (v[r] + v[l] == n) return printf("%d %d\n", v[l], v[r]), 0;
    (v[r] + v[l] > n) ? r-- : l++;
  }
}
