#include <iostream>
#include <string>
#include <algorithm>
#include <functional>
#include <vector>
#include <utility>
#include <cstring>
#include <iomanip>
#include <numeric>
#include <cmath>
#include <cassert>
using namespace std;
using ll = long long;
const int INF = 1<<30;
const int MOD = 1e9 + 7;
const int MAX_N = 1e5 + 10;
int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n;
    vector<int> prime(MAX_N, 1);
    prime[0] = prime[1] = 0;
    for(int i = 2; i * i < MAX_N; i++)
    {
        for(int j = 2 * i; j < MAX_N; j += i) prime[j] = 0;
    }
    while(cin >> n, n)
    {
        for(int i = n; i >= 0; i--)
        {
            if(prime[i] and prime[i - 2])
            {
                cout << i - 2 << " " << i << endl;
                break;
            }
        }
    }
    return 0;
}


