#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  long long int N;
  cin >> N;
  if (N % 2 == 0) {
    cout << "4 " << N - 4 << endl;
  } else {
    cout << "9 " << N - 9 << endl;
  }
  return 0;
}
