#include <bits/stdc++.h>
using namespace std;
int main() {
  long double n, item, temp = 8, temp1, temp2, temp3, sum;
  cin >> n;
  item = n - temp;
  long double x, y;
  while (1) {
    sum = temp + item;
    x = (temp - 1) / 6;
    y = (temp + 1) / 6;
    temp1 = (item - 1) / 6;
    temp2 = (item + 1) / 6;
    if ((roundf(x) == x || roundf(y) == y) ||
        (roundf(temp1) == temp1 || roundf(temp2) == temp2)) {
      if ((temp + item) > n) {
        break;
      }
      temp++;
      item--;
    } else {
      break;
    }
  }
  cout << temp << " " << item;
  return 0;
}
