#include <cmath>
#include <iostream>

using namespace std;

bool prime_check(int N)
{
	if (N == 1) { return false; }

	for (int i = 2; i <= sqrt(N); i++)
	{
		if (N % i == 0)
		{
			return false;
		}
	}

	return true;
}

int main()
{
	int N[100], I[100], c = 0;

	while (cin >> N[c])
	{
                if(N[c] == -1){ goto END; }

		for (int i = (N[c] - 1); i > 1; i--)
		{
			if (prime_check(i) == true && prime_check(i - 2) == true)
			{
				I[c] = i; goto Exit;
			}
		}
	Exit:;

            c++;
	}

        END:;

        for(int i = 0; i < c; i++)
        {
            cout << I[i - 2] << ' ' << I[i] << endl;
        }

	return 0;
}