#include <bits/stdc++.h>
using namespace std;
#define int long long
#define UNIQUE(v) v.erase(unique(all(v)), v.end());
#define ZIP(v) sort(all(v)),UNIQUE(v)
#define ADD(a, b) a = (a + b) % mod
#define MUL(a, b) a = (a * b) % mod
#define repi(i,m,n) for(int i = m;i < n;i++)
#define drep(i,n,m) for(int i = n;i >= m;i--)
#define rep(i,n) repi(i,0,n)
#define rrep(i,n) repi(i,1,n+1)
#define chmin(x,y) x = min(x,y)
#define chmax(x,y) x = max(x,y)
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(), v.rend()
#define dmp(x,y) make_pair(x,y)
#define pb(x) push_back(x)
#define fi first
#define se second
typedef pair<int,int> P;
typedef pair<int, P> PP;
typedef vector<int> vi;
const int inf = 1e9+7;
const int INF = 1e18+7;
//26

int dp[20000];
signed main(){
	fill(dp, dp+20000, 1);
	dp[0] = dp[1] = 0;
	repi(i,2,10002){
		if(dp[i] == 1)for(int j = 2;i*j <= 10001;j++){
			dp[i*j] = 0;
		}
	}
	
	while(1){
		int n;
		scanf("%lld", &n);
		if(n == 0)break;
		P p = P(3, 5);
		repi(i,5,n+1){
			if(dp[i] == 1 and dp[i-2] == 1)p = P(i-2, i);
		}
		printf("%lld %lld\n", p.fi, p.se);
	}
	//rep(i,15)printf("%lld %lld\n", i, dp[i]);
	return 0;
}




