#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int i, j, k, cnt = 0, n, a, b, c;
  cin >> n;
  if (n % 2 == 0) {
    a = n / 2;
    if (a % 2 == 0)
      cout << n / 2 << " " << n / 2;
    else
      cout << n - 10 << " " << 10;
  } else {
    cout << n - 9 << " " << 9;
  }
}
