#include <bits/stdc++.h>
using namespace std;
int n, ans1, ans2;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cin >> n;
  if (n % 2 == 0) {
    ans1 = 4;
    ans2 = n - 4;
  } else {
    ans1 = 9;
    ans2 = n - 9;
  }
  cout << ans1 << " " << ans2 << '\n';
  return 0;
}
