#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n, i, a, b, d, c = 0;
  cin >> n;
  for (int k = 4; k < n; k += 2) {
    d = n - k;
    for (int j = 2; j < d; j++) {
      if (d % j == 0) {
        cout << k << ' ' << d << endl;
        exit(0);
      }
    }
  }
}
