#include <bits/stdc++.h>
using namespace std;
long long n, m, c;
bool used[2000001], us[2000001];
void t() {
  used[1] = 0;
  for (int i = 2; i <= 1000000; i++)
    if (!used[i]) {
      for (int j = min(i * 2, 1000000); j <= 1000000; j += i) used[j] = 1;
    }
}
int main() {
  t();
  for (int i = 1; i <= 1000000; i++)
    if (used[i]) us[i] = 1;
  cin >> n;
  for (int i = 1; i <= n; i++)
    if (us[i] && us[n - i]) {
      cout << i << " " << n - i << endl;
      return 0;
    }
  return 0;
}
