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

bool isPrime(int x) {
  if(x == 0 || x == 1) return false;
  for(int i = 2; i*i <= x; ++i) {
    if(x % i == 0) return false;
  }
  return true;
}

int main() {
  int n;
  while(cin >> n && n) {
    int p, q;
    for(int x = 3; x+2 <= n; ++x) {
      if(isPrime(x) && isPrime(x+2)) {
        p = x;
        q = x+2;
      }
    }
    cout << p << " " << q << endl;
  }
  return 0;
}