#include <bits/stdc++.h>
using namespace std;
long long SUPERBIG = 1e6 + 1;
int main() {
  long long n, tmp, temp;
  cin >> n;
  if (n % 2 == 0)
    printf("4 %lld", n - 4);
  else
    printf("9 %lld", n - 9);
  return 0;
}
