#include <bits/stdc++.h>
using namespace std;
const int inf = 1000000000, maksn = 1000000;
const double pi = 3.141592653589793;
const double eps = 1e-7;
bool sito[maksn];
int main() {
  for (int i = 0; i < (maksn); i++) sito[i] = 1;
  sito[1] = 0;
  for (int i = 2; i * i < maksn; i++)
    if (sito[i])
      for (int j = i * i; j < maksn; j += i) sito[j] = 0;
  int n;
  cin >> n;
  for (int i = (2); i <= (n - 2); i++)
    if (sito[i] == 0 && sito[n - i] == 0) {
      cout << i << " " << n - i;
      return 0;
    }
}
