#include <iostream>
#include <vector>
#include <cmath>

#define REP(i,k,n) for(int i=k;i<n;i++)
#define rep(i,n) for(int i=0;i<n;i++)

using namespace std;

int prime[10001];

void CreatePrime(int n)
{
	rep(i,n)
	{
		prime[i] = 1;
	}

	prime[0] = prime[1] = 0;

	REP(i,2,sqrt(n))
	{
		if(prime[i])
		{
			for(int j=0;i*(j+2) < n;j++)
			{
				prime[i*(j+2)] = 0;
			}
		}
	}
}

int main()
{
	int n;
	vector<int> v;
	vector<pair<int,int> > ans;

	CreatePrime(10001);
	while(cin >> n && n)
	{
		rep(i,n+1)
		{
			if(prime[i]) v.push_back(i);
		}
		
		rep(i,v.size()-1)
		{
			REP(j,i+1,v.size())
			{
				if(v[j] - v[i] == 2)
				{
					ans.push_back(make_pair(v[i],v[j]));				
				}

				else if(v[j] - v[i] > 2)
				{
					break;
				}
			}
		}

		cout << ans[ans.size()-1].first << " " << ans[ans.size()-1].second << endl;
	}
	return 0;
}