#include <bits/stdc++.h>
using namespace std;
int prime(int a) {
  int f = 0;
  for (int i = 2; i < a; i++) {
    if (a % i == 0) f = 1;
  }
  return f;
}
int main() {
  long long n;
  cin >> n;
  long long a = 4;
  long long b = n - 4;
  int f1 = prime(a);
  int f2 = prime(b);
  while (f1 != 1 || f2 != 1) {
    a++;
    b--;
    f1 = prime(a);
    f2 = prime(b);
  }
  cout << a << " " << b;
  return 0;
}
