#include <bits/stdc++.h>
using namespace std;
using std::cout;
using std::endl;
using std::string;
using ll = long long;
using vi = vector<int>;
using ld = long double;
using vb = vector<bool>;
using pii = pair<int, int>;
using vd = vector<long double>;
using vl = vector<long long>;
signed int main() {
  int n;
  cin >> n;
  if (n % 2 == 0)
    cout << n - 8 << " " << n - (n - 8);
  else
    cout << (n - 9) << " " << n - (n - 9);
}
