#include <bits/stdc++.h>
#pragma GCC optimize("O3")
using namespace std;
const int N = (int)1e6 + 100;
const int M = (int)1e4 + 4;
const int INF = (int)0x3f3f3f3f;
long long n = 0;
int Solve() {
  std::ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  cin >> n;
  cout << (n % 2) + 8 << ' ' << n - ((n % 2) + 8) << endl;
  return 0;
}
int main() {
  Solve();
  return 0;
}
