#include <bits/stdc++.h>
using namespace std;
int dd[2 * 1000005];
void sangnt() {
  int s = 1000005;
  dd[1] = 1;
  for (int i = 2; i <= s; i++)
    if (dd[i] == 0)
      for (int j = 2; j <= s / i; j++) dd[i * j] = 1;
}
int main() {
  sangnt();
  int n;
  cin >> n;
  for (int i = 2; i <= n; i++)
    if (dd[i] && dd[n - i]) {
      cout << i << " " << n - i;
      return 0;
    }
}
