#include <bits/stdc++.h>
using namespace std;
string tos(int a) {
  ostringstream os("");
  os << a;
  return os.str();
}
const int MAXN = 1000000;
bool isp[MAXN + 100];
int main() {
  ios_base::sync_with_stdio(0);
  for (int i = 0; i <= MAXN; ++i) isp[i] = 1;
  isp[0] = isp[1] = 1;
  for (int i = 2; i <= MAXN; ++i)
    if (isp[i])
      for (int j = i + i; j <= MAXN; j += i) isp[j] = 0;
  int n;
  while (cin >> n) {
    int x, y;
    for (int i = 2; i < MAXN; ++i) {
      x = i, y = n - x;
      if (!isp[x] && !isp[y]) break;
    }
    cout << x << ' ' << y << '\n';
  }
  return 0;
}
