#include <bits/stdc++.h>
using namespace std;
void twin() {
  int f;
  for (int i = 1; i <= 100000; i++) {
    f = 0;
    for (int j = 2; j <= sqrt(i); j++) {
      if (i % j == 0) {
        f = 1;
        break;
      }
    }
  }
}
int main() {
  long long n;
  {
    cin >> n;
    if (n % 2 == 0)
      cout << "6 " << n - 6 << endl;
    else
      cout << "9 " << n - 9 << endl;
  }
  return 0;
}
