#include <cmath>
#include <cstring>
#include <iostream>
#include <ostream>
#include <vector>
 
using std::cin;
using std::cout;
using std::cerr;
using std::endl;
 
template <typename T>
std::ostream& operator<<(std::ostream& os, std::vector<T> v) {
  os << "[";
  for(int i = 0; i < int(v.size()); i++) {
    os << v[i] << (i == int(v.size()) - 1 ? "" : ", ");
  }
  os << "]";
  return os;
}
 
// n 以下の素数のリストを返す O(nlog(log(n)))
std::vector<int> eratosthenes(int n) {
  std::vector<int> is_prime(n + 1, 1);
  std::vector<int> primes;

  is_prime[0] = is_prime[1] = 0;
  primes.push_back(2);
  for(int i = 3; i <= n; i += 2) {
    if(is_prime[i]) {
      primes.push_back(i);
      for(int j = 3; i * j <= n; j += 2) {
        is_prime[i * j] = 0;
      }
    }
  }

  return primes;
}
 
int main() {
  int n;
  std::vector<int> primes = eratosthenes(10000);
 
  while(cin >> n, n) {
    int a = 2, b = 3;
    for(int i = 1; i < primes.size(); i++) {
      if (primes[i] > n) break;

      if(primes[i] - primes[i - 1] == 2) {
        a = primes[i - 1];
        b = primes[i];
      }
    }
    cout << a << " " << b << endl;
  }
 
  return 0;
}


#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <algorithm>
#include <bitset>
#include <cstring>
#include <string.h>
#include <cmath>
#include <queue>
#include <string>
#include <stack>
#include <utility>
#include <queue>
#include <cmath>
#define mp make_pair
#define pii pair<int,int> 
#define ff first
#define ss second
#define ll long long 
#define vi vector<int>

using namespace std;

ll _sieve_size; 
bitset<10000010> bs; 
vi primes; 
void sieve(ll upperbound) { 
_sieve_size = upperbound + 1; 
bs.set(); 
bs[0] = bs[1] = 0; 
for (ll i = 2; i <= _sieve_size; i++) if (bs[i]) {
for (ll j = i * i; j <= _sieve_size; j += i) bs[j] = 0;
primes.push_back((int)i);
} } 
bool isPrime(ll N) { 
if (N <= _sieve_size) return bs[N]; 
for (int i = 0; i < (int)primes.size(); i++)
if (N % primes[i] == 0) return false;
return true; 
} 

int a;

int main()
{
	sieve(11000);
	while(1)
	{	
		scanf("%d",&a);
		if(a==0)break;
		if(a%2==0)
		a-=3;
		else
		a-=2;
		//printf("%d",b);
		while(1)
		{
			if(isPrime(a)&&isPrime(a+2))
			{
				printf("%d %d\n",a,a+2);
				break;
			}
			a-=2;
		}
	}
}