#include <bits/stdc++.h>
const int max_size = 101;
using namespace std;
int main() {
  long long n, a, b;
  std::cin >> n;
  if (n % 2 == 0)
    cout << 8 << " " << n - 8;
  else
    cout << 9 << " " << n - 9;
}
