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

int main() {
  cin.tie(nullptr);
  ios_base::sync_with_stdio(false);
  constexpr int max = 10000;
  vector<bool> isPrime(max, true);
  isPrime[0] = isPrime[1] = false;
  for (int i = 2; i * i < max; i++) {
    if (isPrime[i]) {
      for (int j = i * 2; j < max; j += i) {
        isPrime[j] = false;
      }
    }
  }
  int n;
  while (cin >> n, n) {
    for (int i = n; i >= 5; i--) {
      if (isPrime[i] && isPrime[i - 2]) {
        cout << i - 2 << " " << i << "\n";
        break;
      }
    }
  }
}
