#include <bits/stdc++.h>
using namespace std;
const int MID = 1e5;
const int MAX = 1e9;
int main() {
  int n;
  cin >> n;
  if (n % 2) {
    cout << n - 9 << " " << 9;
  } else {
    cout << n - 8 << " " << 8;
  }
  return 0;
}
