#include <bits/stdc++.h>
using namespace std;
const int ml = 1000001;
bool isnpr(int n) {
  for (int c = 2; c * c <= n; ++c)
    if (n % c == 0) return 1;
  return 0;
}
void proc(int n) {
  for (int c = 4; c < ml; ++c) {
    if (isnpr(c) && isnpr(n - c)) {
      cout << c << ' ' << n - c;
      return;
    }
  }
}
int main() {
  int n = 0;
  cin >> n;
  proc(n);
  return 0;
}
