#include <bits/stdc++.h>
using namespace std;

vector<int> prime;
vector<int> ls;

void sieve(int N){
    prime.resize(N+1,1);
    prime[0] = prime[1] = 0;
    for(int i=2;i*i<=N;i++){
        for(int j=i*i;j<=N;j+=i){
            prime[j] = 0;
        }
    }
    for(int i=2;i<=N;i++){
        if(prime[i])ls.push_back(i);
    }
}

int main() {
    sieve(int(1e5));
    int n;
    while(cin >> n, n){
        int p, q;
        for(int i=0;ls[i]<=n-2;i++){
            if(ls[i+1]-ls[i]==2){
                p = ls[i];
                q = ls[i+1];
            }
        }
        cout << p << " " << q << endl;
    }
    return 0;
}
