#include <iostream>
#include <cstdio>
#include <string>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <cmath>
#include <sstream>
#include <algorithm>
using namespace std;

typedef long long ll;
typedef pair<int,int> P;
const int MAX=1000000000;

vector<int> sieve(int n) {
  vector<int> prime(n);
  for(int i=2; i<n; i++) prime[i]=i;
  for(int i=2; i*i<n; i++) {
    if(prime[i]) {
      for(int j=i*i; j<n; j+=i) prime[j]=0;
    }
  }
  prime.erase(remove(prime.begin(),prime.end(),0),prime.end());
  return prime;
}

int main() {
  vector<int> prime = sieve(10000);
  vector<P> v;
  for(int i=0; i<prime.size()-1; i++) {
    if(prime[i+1]-prime[i]==2) v.push_back(P(prime[i],prime[i+1]));
  }
  int n;
  while(cin >> n && n) {
    int l=0,r=v.size(),m;
    while(l+1!=r) {
      m = (l+r)/2;
      if(v[m].second>n) r=m;
      else l=m;
    }
    cout << v[l].first << " " << v[l].second << endl;
  }
  return 0;
}
