#include <bits/stdc++.h>
using namespace std;
int main() {
  long n;
  cin >> n;
  if ((n & 1) == 0)
    cout << "8"
         << " " << (n - 8);
  else
    cout << "9"
         << " " << (n - 9);
  return 0;
}
