#include <stdio.h>
const int MAX_V = 1000000; // 100????????§?´???°??¨?????????
int prime[MAX_V+1]; // 1????´???°???0????´???°??§?????? 
int main() {
    int i, k, v,a=0,n;
    for(i = 2; i <= MAX_V; i++) {
        prime[i] = 1; // 2??\????´???°??¨??????
    } 
    for(i = 2; i*i <= MAX_V; i++) {
        if(prime[i]) {
            for(k = 2 * i; k <= MAX_V; k += i) {
                prime[k] = 0; // ?´???°2?????\????????°?´???°??§?????? 
            }
            
        } 
        
    }
    while(1){
      scanf("%d",&n);
      if(n==0)break;
      for(i=0;i<n-2;i++){
          int isprime = prime[i];
          int isprimex = prime[i+2];
          if(isprime && isprimex){
             if(a<i)a=i;
          }
        }
        printf("%d %d\n",a,a+2);
    }
    return 0; 
    
}