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