#include <bits/stdc++.h>
using namespace std;
bool prost(int x) {
  for (int i = 2; i * i <= x; i++) {
    if (x % i == 0) return false;
  }
  return true;
}
int main() {
  ios::sync_with_stdio(false);
  int n;
  cin >> n;
  if (prost(n - 4) == false) {
    cout << "4 " << n - 4 << endl;
  } else if (prost(n - 9) == false) {
    cout << "9 " << n - 9 << endl;
  }
  return 0;
}
