#include <bits/stdc++.h>
using namespace std;
void Solve() {
  long long n;
  cin >> n;
  if (n % 2 == 0)
    cout << "4 " << n - 4 << "\n";
  else
    cout << "9 " << n - 9 << '\n';
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  int t = 1;
  while (t--) {
    Solve();
  }
  return 0;
}
