#include<iostream>
using namespace std;
int zhishu(int shu){
int p = 1;
for(int i = 2;i < shu;i ++){//函数判断素数
if(shu % i == 0){
p = 0;
}
}
if(shu == 1){
p = 0;
}
return p;
}
int main(){
int a,g,k;
cin >> a;
for(int i = 3;i < a - 1;i ++){
g = zhishu(i);
k = zhishu(i + 2);
if(g == 1 and k == 1){
cout << i << " " << i + 2 << endl;//输出素数对
} else {
}
}
}