#include <iostream>
#include <cmath>
using namespace std;

bool check(int p1) {
	for (int j = 2; j <= sqrt(p1); j++) {
		if (p1 % j == 0)
			return 0;
	}

	return 1;
}

int main()
{	
	int n;

	cin >> n;

	while (n > 0) {
		int p = n;

		while (p > 3 && (!check(p) || !check(p - 2)))
			p--;

		cout << p - 2 << " " << p << endl;

		cin >> n;
	}

	return 0;
}

