stablegradients/pie-gem5-pairs huggingface dataset:
// Slower C++ solution:
#include <iostream>

#include <vector>

#include <algorithm>

#include <string.h>

#include <iomanip>

#include <math.h>



typedef long long int ll;



#define FOR(i,n,m) for(ll i=(ll)(m);i<(ll)(n);++i)

#define REP(i,n) FOR(i,n,0)

#define IREP(i,n) for(ll i=(ll)(n);i>=0;--i)

#define OF64 std::setprecision(10)



const ll MOD = 1000000007;



using namespace std;



const int MAX = 300000;



int Prime[55555];

bool isPrime[MAX];





int main()

{

	int N;

	cin >> N;

	REP(i, MAX)

	{

		isPrime[i] = true;

	}



	int num = 0;

	isPrime[0] = isPrime[1] = false;

	for (int i = 2; i < MAX; ++i)

	{

		if (!isPrime[i])continue;

		if (i <= 55555)

		{

			Prime[num++] = i;

		}

		for (int j = 2 * i; j < MAX; j += i)

		{

			isPrime[j] = false;

		}

	}



	vector<int> ans;

	REP(i, num)

	{

		if (Prime[i] % 10 == 1)

		{

			ans.push_back(Prime[i]);

		}

		if (ans.size() == N)break;

	}



	cout << ans[0];

	REP(i, N-1)

	{

		cout << " " << ans[i + 1];

	}

	cout<<endl;



	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 2.6514416468178372x):
#include <iostream>

#include <vector>

#include <algorithm>

#include <string.h>

#include <iomanip>

#include <math.h>



typedef long long int ll;



#define FOR(i,n,m) for(ll i=(ll)(m);i<(ll)(n);++i)

#define REP(i,n) FOR(i,n,0)

#define IREP(i,n) for(ll i=(ll)(n);i>=0;--i)

#define OF64 std::setprecision(10)



const ll MOD = 1000000007;



using namespace std;



struct PrimeList

{

	PrimeList()

	{

		prime.clear();

	};

	~PrimeList() {};



	void init(int n)

	{

		std::vector<bool> isComposite(n + 1);

		for (int i = 2; i <= n; ++i)

		{

			if (isComposite[i])continue;

			prime.push_back(i);

			for (int j = i; j <= n; j += i)

			{

				isComposite[j] = true;

			}

		}

	}



	std::vector<int> prime;

};





int main()

{



	int N;

	cin >> N;

	PrimeList prime;

	prime.init(55555);



	vector<int> ans;

	REP(i, prime.prime.size())

	{

		if (prime.prime[i] % 10 == 1)ans.push_back(prime.prime[i]);

		if (ans.size() == N)break;

	}



	REP(i, N)

	{

		cout << ans[i] << " ";

	}

	cout << endl;

	return 0;

}
// Slower C++ solution:
#include <iostream>

#include <string.h>

#include <stdio.h>

#include <algorithm>

using namespace std;

int t[1000];

int p[56];

int r[1000];

int o;

int book[1000000];

int main()

{



    int u=0;

    for(int i=2; i<10000; i++)

    {

        if(book[i]==0)

            for(int j=2; j<10000; j++)

            {

                if(i*j>=10000)

                    break;

                book[i*j]=1;

            }

    }

    int n;

    int f[56];

    int v=0;

    for(int i=2;i<=10000;i++)

    {

        if(book[i]==0&&i%10==1)

        {

            f[v]=i;

            v++;

            if(v==57)

                break;

        }

    }

    while(scanf("%d",&n)!=EOF)

    {

        for(int i=0; i<n; i++)

            {

                if(i==0)

                    cout<<f[i];

                else

                    cout<<" "<<f[i];

            }

            cout<<endl;

    }

    return 0;

}


// Faster C++ solution for the same problem (measured speedup: 1.1115628872207404x):
#include <stdio.h>

#include <string.h>

#include <iostream>

#include <stack>

#include <queue>

#include <vector>

#include <cmath>

#include <algorithm>

#define LL long long

using namespace std;

/*int main()

{

    int x=11,j=0,i=0;

    while(j<56)

    {

        for( i=2; i<x/2; i++)

            if(x%i==0)break;

        if(i>=x/2)

        {

            printf("%d,",x);

            j++;

        }

        x+=10;

    }

}*/

int main()

{

    int zishu1[56]={11,31,41,61,71,101,131,151,181,191,211,241,251,271,281,311,331,401,421,431,461,491,521,541,571,601,631,641,661,691,701,751,761,811,821,881,911,941,971,991,1021,1031,1051,1061,1091,1151,1171,1181,1201,1231,1291,1301,1321,1361,1381,1451};

    int n;

    scanf("%d",&n);

    for(int i=0;i<n;i++)

    {

        if(i==0)printf("%d",zishu1[i]);

        else printf(" %d",zishu1[i]);

    }

    printf("\n");

    return 0;

}
// Slower C++ solution:
#include <bits/stdc++.h>



using namespace std;



typedef long long ll;

typedef unsigned long long ull;

typedef vector<int> vi;

typedef pair<int,int> ii;

typedef pair<int,pair<int,int>> iii;

typedef vector<pair<int,int>> vii;

typedef vector<vector<int>> vvi;



#define pb push_back

#define mp make_pair

#define fi first

#define se second

#define LSOne(i) ((i) & -(i))



const int MAXN = 55556;

bitset<MAXN> bs;

int n;

vi primes, ans;



void sieve () {

    bs.set();

    bs[0] = bs[1] = false;

    for (ll i = 2; i < bs.size(); i++) {

        if (bs[i]) {

            for (ll j = i*i; j < bs.size(); j += i)

                bs[j] = false;

            if (i%10 == 1) primes.pb(i);

        }

    }

}



int main (void) {

    ios_base::sync_with_stdio(false);

    cin.tie(0); cout.tie(0);



    cin >> n;

    sieve();



    for (int i = 0; i < n; i++)

        cout << primes[i] << " ";

    cout << endl;



    return 0;

}


// Faster C++ solution for the same problem (measured speedup: 1.3899225541463232x):
#include <stdio.h>

#include <string.h>

#include <iostream>

#include <stack>

#include <queue>

#include <vector>

#include <cmath>

#include <algorithm>

#define LL long long

using namespace std;

/*int main()

{

    int x=11,j=0,i=0;

    while(j<56)

    {

        for( i=2; i<x/2; i++)

            if(x%i==0)break;

        if(i>=x/2)

        {

            printf("%d,",x);

            j++;

        }

        x+=10;

    }

}*/

int main()

{

    int zishu1[56]={11,31,41,61,71,101,131,151,181,191,211,241,251,271,281,311,331,401,421,431,461,491,521,541,571,601,631,641,661,691,701,751,761,811,821,881,911,941,971,991,1021,1031,1051,1061,1091,1151,1171,1181,1201,1231,1291,1301,1321,1361,1381,1451};

    int n;

    scanf("%d",&n);

    for(int i=0;i<n;i++)

    {

        if(i==0)printf("%d",zishu1[i]);

        else printf(" %d",zishu1[i]);

    }

    printf("\n");

    return 0;

}
// Slower C++ solution:
#include <bits/stdc++.h>



using namespace std;



typedef long long ll;

typedef unsigned long long ull;

typedef vector<int> vi;

typedef pair<int,int> ii;

typedef pair<int,pair<int,int>> iii;

typedef vector<pair<int,int>> vii;

typedef vector<vector<int>> vvi;



#define pb push_back

#define mp make_pair

#define fi first

#define se second

#define LSOne(i) ((i) & -(i))



const int MAXN = 55556;

bitset<MAXN> bs;

int n;

vi primes, ans;



void sieve () {

    bs.set();

    bs[0] = bs[1] = false;

    for (ll i = 2; i < bs.size(); i++) {

        if (bs[i]) {

            for (ll j = i*i; j < bs.size(); j += i)

                bs[j] = false;

            if (i%10 == 1) primes.pb(i);

        }

    }

}



int main (void) {

    ios_base::sync_with_stdio(false);

    cin.tie(0); cout.tie(0);



    cin >> n;

    sieve();



    for (int i = 0; i < n; i++)

        cout << primes[i] << " ";

    cout << endl;



    return 0;

}


// Faster C++ solution for the same problem (measured speedup: 1.3071239686364051x):
#include <iostream>

#include <algorithm>

#include <vector>

#include <cstring>



using namespace std;



int prime(int x) {

	for (int i = 3; i * i <= x; i += 2)

		if (x % i == 0) return 0;

	return 1;

}



vector<int> ans;



int main() {

	for (int i = 11; i <= 5555; i += 10)

		if (prime(i)) ans.push_back(i);

	int n;

	cin >> n;

	for (int i = 0; i < n; ++i) cout << ans[i] << ' ';

	return 0;

}
// Slower C++ solution:
#include <cstdio>

#include <iostream>

#include <algorithm>

#include <cstring>

#include <queue> //priority_queue

#include <map>

#include <set> //multiset set<int,greater<int>>大到小

#include <vector>// vector<int>().swap(v);清空释放内存

#include <stack>

#include <cmath> // auto &Name : STLName  Name.

#include <utility>

#include <sstream>

#include <string>//__builtin_popcount(ans);//获取某个数二进制位1的个数

#define mod 1000000007

#define mod9 998244353

typedef unsigned long long ull;

typedef long long ll;

typedef double db;

typedef long double ld;

const db eps=1e-10;

const int INF = 0x3f3f3f3f;

const ll inf=0x3f3f3f3f3f3f3f3f;

#define rep(i,be,en) for (int i=be;i<=en;i++)

#define per(i,be,en) for (int i=en;i>=be;i--)

//ll ksm(ll a,ll b,ll c){ll ans=1;a=a%c;while(b>0){if(b%2) ans=(ans*a)%c;b=b/2;a=(a*a)%c;}return ans;}

using namespace std;



const int N=2e5+7;

int t,n,m,fl=0;

int prime[N]={0};//记录素数

int vis[N]={0};//记录除本身最大因子

int cnt=0;//素数个数

void Euler_prime(int x){

    for(int i=2;i<=x;++i){

        if(vis[i]==0){

            prime[cnt++]=i;

            vis[i]=1;

        }

        for(int j=0;j<cnt;++j){

            if(i*prime[j]>x)//判断是否越界

                break;

            vis[i*prime[j]]=i;//筛数

            if(i%prime[j]==0)//时间复杂度为O(n)的关键！

                break;

        }

    }

}

int main(){

    Euler_prime(55556);

    scanf("%d",&n);

    rep(i,0,cnt-1){

        if(prime[i]%10==1){

            printf("%d%c",prime[i],n==1?'\n':' ');

            n--;

        }

        if(n<=0) break;

    }

    return 0;

}

// Faster C++ solution for the same problem (measured speedup: 1.6571627264213347x):
#include <iostream>

#include <algorithm>

#include <vector>

#include <cstring>



using namespace std;



int prime(int x) {

	for (int i = 3; i * i <= x; i += 2)

		if (x % i == 0) return 0;

	return 1;

}



vector<int> ans;



int main() {

	for (int i = 11; i <= 5555; i += 10)

		if (prime(i)) ans.push_back(i);

	int n;

	cin >> n;

	for (int i = 0; i < n; ++i) cout << ans[i] << ' ';

	return 0;

}
// Slower C++ solution:
#include <iostream>

#include <string.h>

#include <stdio.h>

#include <algorithm>

using namespace std;

int t[1000];

int p[56];

int r[1000];

int o;

int book[1000000];

int main()

{



    int u=0;

    for(int i=2; i<10000; i++)

    {

        if(book[i]==0)

            for(int j=2; j<10000; j++)

            {

                if(i*j>=10000)

                    break;

                book[i*j]=1;

            }

    }

    int n;

    int f[56];

    int v=0;

    for(int i=2;i<=10000;i++)

    {

        if(book[i]==0&&i%10==1)

        {

            f[v]=i;

            v++;

            if(v==57)

                break;

        }

    }

    while(scanf("%d",&n)!=EOF)

    {

        for(int i=0; i<n; i++)

            {

                if(i==0)

                    cout<<f[i];

                else

                    cout<<" "<<f[i];

            }

            cout<<endl;

    }

    return 0;

}


// Faster C++ solution for the same problem (measured speedup: 1.0949678821836413x):
#include <iostream>

#include <algorithm>

#include <cstdio>

#include <cstring>

#include <cmath>

#include <set>

#include <map>

#include <vector>

#include <queue>

#define LL long long

#define N 55555

#define maxn 10005

#define INF 0x3f3f3f3f

#define mase(a,b) memset(a,b,sizeof(a))

#define MIN(a,b) (a<b?a:b)

#define MAX(a,b) (a>b?a:b)

#define DS DisputeSegement

using namespace std;

bool isPrime(int fig)

{

    int limit=(int)sqrt(fig)+1;

    for(int i=2;i<limit;i++)

    {

        if(fig%i==0)

        {

            return false;

        }



    }

    return true;

}

int main()

{

    int n;

    scanf("%d",&n);

    for(int i=11;i<=N;i+=10)

    {

        if(isPrime(i))

        {

            printf("%d",i);

            n--;

            printf("%c",n?' ':'\n');

            if(!n)

            {

                break;

            }

        }

    }

    return 0;

}





//Five,Five Everywhere,原创者CSDN@
// Slower C++ solution:
#include <bits/stdc++.h>



using namespace std;



typedef long long ll;

typedef unsigned long long ull;

typedef vector<int> vi;

typedef pair<int,int> ii;

typedef pair<int,pair<int,int>> iii;

typedef vector<pair<int,int>> vii;

typedef vector<vector<int>> vvi;



#define pb push_back

#define mp make_pair

#define fi first

#define se second

#define LSOne(i) ((i) & -(i))



const int MAXN = 55556;

bitset<MAXN> bs;

int n;

vi primes, ans;



void sieve () {

    bs.set();

    bs[0] = bs[1] = false;

    for (ll i = 2; i < bs.size(); i++) {

        if (bs[i]) {

            for (ll j = i*i; j < bs.size(); j += i)

                bs[j] = false;

            if (i%10 == 1) primes.pb(i);

        }

    }

}



int main (void) {

    ios_base::sync_with_stdio(false);

    cin.tie(0); cout.tie(0);



    cin >> n;

    sieve();



    for (int i = 0; i < n; i++)

        cout << primes[i] << " ";

    cout << endl;



    return 0;

}


// Faster C++ solution for the same problem (measured speedup: 1.3691717967646087x):
#include <iostream>

#include <algorithm>

#include <cstdio>

#include <cstring>

#include <cmath>

#include <set>

#include <map>

#include <vector>

#include <queue>

#define LL long long

#define N 55555

#define maxn 10005

#define INF 0x3f3f3f3f

#define mase(a,b) memset(a,b,sizeof(a))

#define MIN(a,b) (a<b?a:b)

#define MAX(a,b) (a>b?a:b)

#define DS DisputeSegement

using namespace std;

bool isPrime(int fig)

{

    int limit=(int)sqrt(fig)+1;

    for(int i=2;i<limit;i++)

    {

        if(fig%i==0)

        {

            return false;

        }



    }

    return true;

}

int main()

{

    int n;

    scanf("%d",&n);

    for(int i=11;i<=N;i+=10)

    {

        if(isPrime(i))

        {

            printf("%d",i);

            n--;

            printf("%c",n?' ':'\n');

            if(!n)

            {

                break;

            }

        }

    }

    return 0;

}





//Five,Five Everywhere,原创者CSDN@
// Slower C++ solution:
#include <cstdio>

#include <iostream>

#include <algorithm>

#include <cstring>

#include <queue> //priority_queue

#include <map>

#include <set> //multiset set<int,greater<int>>大到小

#include <vector>// vector<int>().swap(v);清空释放内存

#include <stack>

#include <cmath> // auto &Name : STLName  Name.

#include <utility>

#include <sstream>

#include <string>//__builtin_popcount(ans);//获取某个数二进制位1的个数

#define mod 1000000007

#define mod9 998244353

typedef unsigned long long ull;

typedef long long ll;

typedef double db;

typedef long double ld;

const db eps=1e-10;

const int INF = 0x3f3f3f3f;

const ll inf=0x3f3f3f3f3f3f3f3f;

#define rep(i,be,en) for (int i=be;i<=en;i++)

#define per(i,be,en) for (int i=en;i>=be;i--)

//ll ksm(ll a,ll b,ll c){ll ans=1;a=a%c;while(b>0){if(b%2) ans=(ans*a)%c;b=b/2;a=(a*a)%c;}return ans;}

using namespace std;



const int N=2e5+7;

int t,n,m,fl=0;

int prime[N]={0};//记录素数

int vis[N]={0};//记录除本身最大因子

int cnt=0;//素数个数

void Euler_prime(int x){

    for(int i=2;i<=x;++i){

        if(vis[i]==0){

            prime[cnt++]=i;

            vis[i]=1;

        }

        for(int j=0;j<cnt;++j){

            if(i*prime[j]>x)//判断是否越界

                break;

            vis[i*prime[j]]=i;//筛数

            if(i%prime[j]==0)//时间复杂度为O(n)的关键！

                break;

        }

    }

}

int main(){

    Euler_prime(55556);

    scanf("%d",&n);

    rep(i,0,cnt-1){

        if(prime[i]%10==1){

            printf("%d%c",prime[i],n==1?'\n':' ');

            n--;

        }

        if(n<=0) break;

    }

    return 0;

}

// Faster C++ solution for the same problem (measured speedup: 1.7358265337545606x):
#include <iostream>

#include <algorithm>

#include <cstdio>

#include <cstring>

#include <cmath>

#include <set>

#include <map>

#include <vector>

#include <queue>

#define LL long long

#define N 55555

#define maxn 10005

#define INF 0x3f3f3f3f

#define mase(a,b) memset(a,b,sizeof(a))

#define MIN(a,b) (a<b?a:b)

#define MAX(a,b) (a>b?a:b)

#define DS DisputeSegement

using namespace std;

bool isPrime(int fig)

{

    int limit=(int)sqrt(fig)+1;

    for(int i=2;i<limit;i++)

    {

        if(fig%i==0)

        {

            return false;

        }



    }

    return true;

}

int main()

{

    int n;

    scanf("%d",&n);

    for(int i=11;i<=N;i+=10)

    {

        if(isPrime(i))

        {

            printf("%d",i);

            n--;

            printf("%c",n?' ':'\n');

            if(!n)

            {

                break;

            }

        }

    }

    return 0;

}





//Five,Five Everywhere,原创者CSDN@
// Slower C++ solution:
#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

typedef pair<int,int> iint;

typedef pair<ll,ll> llll;

#define ALL(x) (x).begin(),(x).end()

const ll zero = 0;

const ll INF = 3000000000000000000; //10^18

const int inINF = 1000000000; //10^9

const ll MOD = 1000000007; //10^9+7

const ll MOD2 = 998244353;



int main(){

    int N;

    cin >> N;



    vector<bool> P(56000, true);

    P[0] = false;

    P[1] = false;

    for (int i = 2; i < 56000; i++) {

        if(P[i] == false){

            continue;

        }

        else{

            for (int j = 2; i * j < 56000; j++) {

                P[i * j] = false;

            }

        }

    }

    vector<int> ans;

    for (int i = 1; i < 56000; i+=5) {

        if(P[i] == true){

            ans.push_back(i);

        }

    }

    for (int i = 0; i < N; i++) {

        printf("%d ", ans[i]);

    }

    printf("\n");



}

// Faster C++ solution for the same problem (measured speedup: 1.1831118596725638x):
#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

typedef pair<int,int> iint;

typedef pair<ll,ll> llll;

#define ALL(x) (x).begin(),(x).end()

const ll zero = 0;

const ll INF = 3000000000000000000; //10^18

const int inINF = 1000000000; //10^9

const ll MOD = 1000000007; //10^9+7

const ll MOD2 = 998244353;



int main(){

    int N;

    cin >> N;



    vector<bool> P(56000, true);

    P[0] = false;

    P[1] = false;

    for (int i = 2; i < 250; i++) {

        if(P[i] == false){

            continue;

        }

        else{

            for (int j = i; i * j < 56000; j++) {

                P[i * j] = false;

            }

        }

    }

    vector<int> ans;

    for (int i = 1; i < 56000; i+=5) {

        if(P[i] == true){

            ans.push_back(i);

        }

    }

    for (int i = 0; i < N; i++) {

        printf("%d ", ans[i]);

    }

    printf("\n");



}
// Slower C++ solution:
#include <iostream>

#include <algorithm>

#include <string>

#include <vector>

using namespace std;

typedef long long  ll;

#define rep(i,s,n)for(ll i=s;i<n;i++)

#define repe(i,s,n)for(ll i=s;i<=n;i++)



bool p[100001] = {};

vector<ll> g;



int main() {

	ll n; cin >> n;



	ll size = 100001;

	rep(i, 0, size) p[i] = true;



	p[0] = false;

	p[1] = false;



	for (int i = 2; i*i < size; i++) {

		if (p[i]) {

			for (int j = 2; i*j < size; j++) {

				p[i*j] = false;

			}

		}

	}



	rep(i, 0, size) {

		if (p[i] && i % 10 == 1) {

			g.push_back(i);

		}

	}



	rep(i, 0, n

	) {

		cout << g[i];

		if (i != g.size() - 1) {

			cout << " ";

		}

	}

	cout << endl;



	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 1.1919255196482235x):
#include <iostream>

#include <string>

#include <algorithm>

#include <vector>

#include <map>

using namespace std;

typedef long long  ll;

#define rep(i,s,n)for(ll i=s;i<n;i++)

#define repe(i,s,n)for(ll i=s;i<=n;i++)



bool p[100001];

int main()

{

	ll n; cin >> n;



	ll maxV = 100000;

	rep(i, 0, maxV)p[i] = true;

	p[0] = false;

	p[1] = false;



	for (int i = 2; i*i <= maxV; i++) {

		if (!p[i])continue;

		for (int j = 2; i*j <= maxV; j++) {

			if (i*j <= maxV) {

				p[i*j] = false;

			}

		}

	}



	rep(i, 0, maxV) {

		if (p[i] && i % 10 == 1) {

			cout << i;

			n--;



			if (n != 0)cout << " ";



			if (n == 0) {

				break;

			}

		}

	}

	cout << endl;

	return 0;

}
// Slower C++ solution:
#include <iostream>

#include <algorithm>

#include <string>

#include <vector>

#include <map>

using namespace std;

typedef long long  ll;

#define rep(i,s,n)for(ll i=s;i<n;i++)

#define repe(i,s,n)for(ll i=s;i<=n;i++)



bool p[100000] = {};

vector<ll> ans;



int main() {

	ll n = 100000;

	rep(i, 0, n)p[i] = true;

	p[0] = false;

	p[1] = false;

	for (int i = 2; i*i < n; i++) {

		if (p[i]) {

			for (int j = 2; i*j < n; j++) {

				p[i*j] = false;

			}

		}

	}

	rep(i, 0, n) {

		if (p[i] && i % 10 == 1) {

			ans.push_back(i);

		}

	}



	ll N; cin >> N;

	rep(i, 0, N) {

		cout << ans[i];

		if (i != N - 1) {

			cout << " ";

		}

	}

	cout << endl;

	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 1.1940814380883025x):
#include <iostream>

#include <string>

#include <algorithm>

#include <vector>

#include <map>

using namespace std;

typedef long long  ll;

#define rep(i,s,n)for(ll i=s;i<n;i++)

#define repe(i,s,n)for(ll i=s;i<=n;i++)



bool p[100001];

int main()

{

	ll n; cin >> n;



	ll maxV = 100000;

	rep(i, 0, maxV)p[i] = true;

	p[0] = false;

	p[1] = false;



	for (int i = 2; i*i <= maxV; i++) {

		if (!p[i])continue;

		for (int j = 2; i*j <= maxV; j++) {

			if (i*j <= maxV) {

				p[i*j] = false;

			}

		}

	}



	rep(i, 0, maxV) {

		if (p[i] && i % 10 == 1) {

			cout << i;

			n--;



			if (n != 0)cout << " ";



			if (n == 0) {

				break;

			}

		}

	}

	cout << endl;

	return 0;

}
// Slower C++ solution:
#include <bits/stdc++.h>

using namespace std;

vector<bool> bs(2);

void f(int n)

  {if (n <= 1) return;

  bs.resize(n + 1, true);

  for (int i = 2; i * i <= n; ++i)

    if (bs[i]) for (int j = i + i; j <= n; j += i) bs[j] = false;}

int main()

  {int N; cin >> N;

  f(55555);

  int c = 0;

  for (int j = 2; j <= 55555 and c < N; ++j)

    if (bs[j] and j % 5 == 1) {++c; cout << j << (c == N ? "\n" : " ");}}

// Faster C++ solution for the same problem (measured speedup: 1.1389787171436054x):
#include <bits/stdc++.h>

using namespace std;

bool f(int64_t n)

  {if (n <= 1) return false;

  for (auto i = 2LL; i * i <= n; ++i) if (!(n % i)) return false;

  return true;}

int main()

  {int N; cin >> N;

  for (int i = 2; i <= 55555 and N; ++i)

    if (f(i) and i % 5 == 1) {--N; cout << i << (N ? " " : "\n");}}
// Slower C++ solution:
#include <bits/stdc++.h>

using namespace std;



int main(){

	ios::sync_with_stdio(false);

	cin.tie(0);

	int mx = 55556;

	vector<bool> a(mx);

	fill(a.begin(), a.end(), true);

	a[0] = a[1] = false;

	for(int i = 2; i < mx; i++) {

		if(a[i]) {

			for(int j = i * 2; j < mx; j += i) {

				a[j] = false;

			}

		}

	}

	vector<int> p;

	for(int i = 0; i < a.size(); i++) {

		if(a[i]) {

			p.push_back(i);

		}

	}

	int n;

	cin >> n;

	int cnt = 0;

	for(int i = 0; i < p.size(); i++) {

		if(p[i] % 5 == 1) {

			cout << p[i] << " ";

			cnt++;

		}

		if(cnt == n) {

			cout << endl;

			return 0;

		}

	}

	return 0;	

}


// Faster C++ solution for the same problem (measured speedup: 1.5341515116532694x):
#include <bits/stdc++.h>

using namespace std;



int main(){

	ios::sync_with_stdio(false);

	cin.tie(0);

	int n;

	cin >> n;

	int cnt = 0;

	for(int i = 2; i < 55556; i++) {

		for(int j = 2; j * j <= i; j++) {

			if(i % j == 0) {

				goto NEXT;

			}

		}

		if(i % 5 == 1) {

			cout << i << " ";

			cnt++;

		}

		if(cnt == n) {

			cout << endl;

			return 0;

		}

		NEXT:;

	}

	return 0;	

}