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

vector<int> sosuu(int n){
	vector<int>s;
	bool f[10001];
	f[0]=false;f[1]=false;
	
	for(int i=2; i<n; i++)
	{
		
		if(f[i])
		{
			s.push_back(i);
			for( int j = i*2 ; j<n; j+=i ) {f[j]=false;}
		}
	}
	return s;
}

int main(){
	int n;
	while(cin>>n && n)
	{
		vector<int>so;
		so = sosuu(n);
		for( vector<int>::iterator it=so.end()-1; it != so.begin(); --it)
		{
			if( *(it) - *(it-1) == 2) 
			{
				cout<<*(it-1)<<" "<<*(it)<<endl;
				break;
			}
		}
	}
	return 0;
}