#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int j = 4;
  for (int i = 0; i < 50; i++) {
    int k = n - j;
    if ((k % 2 == 0) || (k % 3 == 0) || (k % 5 == 0) || (k % 7 == 0)) {
      cout << j << " " << k << endl;
      break;
    } else {
      j += 2;
    }
  }
  return 0;
}
