#include <bits/stdc++.h>
using namespace std;
long long n;
void read() {
  cin >> n;
  long long a, b;
  if (n % 2 == 0) {
    a = 4;
    b = n - 4;
  } else {
    a = 9;
    b = n - 9;
  }
  cout << a << " " << b;
}
void solve() { return; }
int main() {
  read();
  solve();
}
