#include <bits/stdc++.h>
using namespace std;
const int N = 1e6 + 10, mod = 1e9 + 7;
int main() {
  int n;
  cin >> n;
  if (n & 1) {
    cout << 9 << " " << n - 9 << endl;
  } else {
    cout << 4 << " " << n - 4 << endl;
  }
  return 0;
}
