#include<stdio.h>
const int MAX_V = 1000000;
int prime[MAX_V+1];
int hurui(int v){
  int i, k;
  for(i = 2; i <= MAX_V; i++) {
    prime[i] = 1;
  }
  for(i = 2; i*i <= MAX_V; i++) {
    if(prime[i]) {
      for(k = 2 * i; k <= MAX_V; k += i) {
        prime[k] = 0;
      }
    }
  }
  int isprime = prime[v];
  if(isprime) {
    return 1;
  }else{
    return 0;
  }
}

int main() {
  int v, k, i = 0, count = 0, q1[100];
  while(scanf("%d", &v) != EOF) {
    if(v == 0){
      break;
    }
    while(1){
      if(hurui(v) == 1 && hurui(v - 2) == 1){
        q1[i] = v;
        break;
      }else{
        v--;
        count ++;
      }
    }
    i++;
  }
  for(k = 0; k < i; k++){
    printf("%d %d\n", q1[k] - 2, q1[k]);
  }
  return 0;
}