#include using lint = long long; void solve() { lint n; std::cin >> n; if (n < 6 || n == 7) { std::cout << -1 << std::endl; return; } if (__builtin_popcountll(n - 3) != 1) { std::cout << 3 << " " << n - 3 << std::endl; } else { std::cout << 5 << " " << n - 5 << std::endl; } } int main() { std::cin.tie(nullptr); std::ios::sync_with_stdio(false); solve(); return 0; }