#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n;
  cin >> n;
  long long int k = 0;
  for (int i = 4; i <= n / 2; i++) {
    int p = 0;
    int q = 0;
    for (int j = 2; j <= i / 2; j++) {
      if (i % j == 0) {
        p = 1;
        break;
      }
    }
    if (p == 1) {
      k = n - i;
      for (int j = 2; j <= k / 2; j++) {
        if (k % j == 0) {
          q = 1;
          break;
        }
      }
      if (q == 1) {
        cout << i << " " << k;
        return 0;
      }
    }
  }
}
