#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  int s;
  cin >> s;
  if (s % 2 == 1)
    cout << s - 9 << ' ' << 9;
  else
    cout << s - 4 << ' ' << 4;
}
