#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <cmath>
#include <queue>
#include <map>
#include <unordered_map>
#include <set>
#include <functional>
#include <bitset>
#include <numeric>
#include <complex>
#include <iomanip>
#include <cassert>
#include <random>


int main() {
    int n; std::cin >> n;
    bool used[1000000] = {};
    std::vector<int> ans;
    for (int i = 2; i <= 55555; i++) {
        if (used[i]) continue;
        if (i % 5 == 1) ans.push_back(i);
        int w = i;
        while (w <= 555555) {
            used[w] = true;
            w += i;
        }
    }
    for (int i = 0; i < n; i++) std::cout << ans[i] << " \n"[i == n - 1];
    return 0;
}

#include<stdio.h>
int main()
{
	int i,j,n;
	const int N=10001;
	bool p[N];
	for(i=2;i<N;++i)p[i]=true;
	for(i=2;i<=N/2;++i)if(p[i])for(j=2*i;j<N;j+=i)p[j]=false;
	while(scanf("%d",&n),n){for(i=n;;--i)if(p[i]&&p[i-2])break;printf("%d %d\n",i-2,i);}
	return 0;
}