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