#include <bits/stdc++.h>
using namespace std;

int main()
{
	int64_t n;
	cin >> n;
	auto bit_count = [](int64_t x) {
		int r = 0;
		for (; x; x >>= 1)
		{
			r += (x & 1);
		}
		return r;
	};
	for (int64_t a = 1; a < min(n, int64_t(1000000)); a++)
	{
		int64_t b = n - a;
		if ((bit_count(a) == 1) || (bit_count(b) == 1))
		{
			continue;
		}
		cout << a << ' ' << b << endl;
		return 0;
	}
	cout << -1 << endl;
	return 0;
}