#include <bits/stdc++.h>
using namespace std;
const long long int maxN = 1000001;
long long int primes[maxN + 10];
void sieve() {
  for (long long int i = 0; i <= maxN; i++) primes[i] = 0;
  for (long long int i = 2; i <= maxN; i++)
    if (primes[i] == 0)
      for (long long int j = i * i; j <= maxN; j += i) primes[j] = 1;
}
void print() {
  for (long long int i = 0; i <= maxN; i++)
    if (primes[i] == 1) cout << i << " ";
  cout << endl;
}
int main() {
  sieve();
  int n;
  cin >> n;
  for (int i = 4; i < maxN; i++)
    if (primes[i] == 1 && primes[n - i] == 1) {
      cout << i << " " << n - i << endl;
      break;
    }
  return 0;
}
