#include <algorithm>
#include <bitset>
#include <cstdio>
#include <cassert>
#include <cmath>
#include <functional>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <tuple>
#include <utility>
#include <vector>
using namespace std;

typedef long long LL;
typedef pair<int, int> P;
typedef pair<LL, LL> PLL;

constexpr int LIM = 10006;

char isprime[LIM];
int twinprime[LIM];

void setprime() {
    fill(isprime, isprime+LIM, 1);
    isprime[0] = isprime[1] = 0;
    for (int x = 2; x * x < LIM; ++x) {
        if (isprime[x]) {
            for (int y = x * x; y < LIM; y += x) {
                isprime[y] = 0;
            }
        }
    }
    for (int x = 5; x < LIM; ++x) {
        if (isprime[x-2] && isprime[x]) {
            twinprime[x] = x;
        } else {
            twinprime[x] = twinprime[x-1];
        }
    }
}

bool solve() {
    int n;
    cin >> n;
    if (n == 0) { return false; }
    int ans = twinprime[n];
    cout << (ans - 2) << ' ' << ans << endl;
    return true;
}

int main() {
    setprime();
    while(solve());
    return 0;
}
#include<bits/stdc++.h>
using namespace std;

int main(){
  int prime[10001]={0};

  prime[0]=prime[1]=1;
  for(int i=2;i<sqrt(10000);i++){
    if(!prime[i]){
      for(int j=0;i*(j+2)<10000;j++){
	prime[i*(j+2)]=1;
      }
    }
  }

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