#include <cstdio>
#include <iostream>
#include <cstring>
using namespace std;

const int MAXN = 10001;

int main()
{
  bool prime[MAXN];

  memset(prime, true, sizeof(prime));
  prime[0] = prime[1] = false;

  for (int i = 2; i * i < MAXN; i++){
    for (int j = i * i; j < MAXN; j += i){
      prime[j] = false;
    }
  }

  int n;
  while (scanf("%d", &n), n){
    for (int i = n;; i--){
      if (prime[i] && prime[i - 2]){
        printf("%d %d\n", i - 2, i);
        break;
      }
    }
  }

  return (0);
}
#include <iostream>
#include <vector>
#include <algorithm>
std::vector<int> twin_primes(int upper) {
	std::vector<bool> suspects(upper + 1, true);
	suspects[0] = suspects[1] = false;
	std::vector<int> res;
	for (auto i = 2; i <= upper; ++i) {
		if (suspects[i]) {
			if (suspects[i - 2])
				res.push_back(i);
			for (auto j = 2 * i; j <= upper; j += i)
				suspects[j] = false;
		}
	}
	return res;
}
int main() {
	int n;
	std::cin >> n;
	auto primes = twin_primes(10000);
	while (n != 0) {
		auto prime = *(std::upper_bound(primes.begin(), primes.end(), n) - 1);
		std::cout << prime - 2 << ' ' << prime << std::endl;
		std::cin >> n;
	}
}
