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