#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int t = n / 12;
  int rem = n % 12;
  int a = 12 * (t - 1);
  switch (rem) {
    case 0:
      cout << 4 * t << " " << 8 * t << endl;
      break;
    case 1:
      cout << a + 4 << " " << 9 << endl;
      break;
    case 2:
      cout << a + 4 << " " << 10 << endl;
      break;
    case 3:
      cout << a + 6 << " " << 9 << endl;
      break;
    case 5:
      cout << a + 8 << " " << 9 << endl;
      break;
    case 7:
      cout << a + 4 << " " << 15 << endl;
      break;
    case 11:
      cout << a + 8 << " " << 15 << endl;
      break;
    default:
      cout << 12 * t << " " << n % 12 << endl;
  }
  return 0;
}
