#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, i = 1, j = 1, c1, c2;
  cin >> n;
  if (n % 2)
    cout << 9 << " " << (n - 9) << endl;
  else
    cout << 8 << " " << (n - 8) << endl;
  return 0;
}
