#include <bits/stdc++.h>
int main() {
  int num;
  while (scanf("%d", &num) != EOF) {
    if (num % 2 == 0) {
      printf("%d %d\n", 4, num - 4);
    } else {
      printf("%d %d\n", 9, num - 9);
    }
  }
  return 0;
}
