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