stablegradients/pie-gem5-bysrc huggingface dataset:
// Original C++ solution (slower):
#include <iostream>

#include <cstdio>

#include <map>

#include <algorithm>

#include <cstring>

#include <string>

#include <cmath>



using namespace std;



const int N = 1e5+5;

int n,m;

int fa[N],r[N];



void init()

{

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

    {

        fa[i] = i;

    }

    memset(r,0,sizeof(r));

}



int Find(int x)

{

    if(fa[x]==x) return x;

    int root = Find(fa[x]);

    r[x] += r[fa[x]];

    return fa[x] = root;

}



bool Merge(int x, int y, int d)

{

    int fx = Find(x);

    int fy = Find(y);

    if(fx==fy)

    {

        return d == r[y]-r[x];

    }

    fa[fy] = fx;

    r[fy] = r[x] + d - r[y];

    return 1;

}



int main()

{

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

    {

        int ok = 1;

        int L,R,D;

        init();

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

        {

            scanf("%d%d%d",&L,&R,&D);

            if(ok && !Merge(L,R,D))

            {

                ok = 0;

            }

        }

        if(ok) printf("Yes\n");

        else printf("No\n");

    }

    return 0;

}


// Optimized solution to the same problem (faster):
#include <stdio.h>

#include <string.h>

#include <stdlib.h>

#include <math.h>

#include <time.h>

#include <iostream>

#include <algorithm>

#include <string>

#include <set>

#include <map>

#include <queue>

#include <stack>

#include <bitset>

#include <vector>

using namespace std;



#define bll long long

#define dou double

#define For(i,a,b) for (int i=(a),_##i=(b); i<=_##i; ++i)

#define Rof(i,a,b) for (int i=(a),_##i=(b); i>=_##i; --i)

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

#define Cpy(a,b) memcpy(a,b,sizeof(b))



const int maxn=1e5+100;

int N,M,u[maxn],link[maxn];

int dlt[maxn];



int get_u(int x,int &ret)

{

    if (x==u[x]) return x;

    u[x]=get_u(u[x],ret);

    ret+=dlt[x];

    dlt[x]=ret;

    return u[x];

}



bool check(int x,int y,int d)

{

    int rx=0,ry=0;

    int a=get_u(x,rx),b=get_u(y,ry);

    if (a==b) return (dlt[y]-dlt[x]==d);

    if (link[a]<link[b]) swap(a,b),swap(x,y),d=-d;

    u[b]=a;

    link[a]+=(link[a]==link[b]);

    dlt[b]=dlt[x]-dlt[y]+d;

    return 1;

}



int main()

{

    for (; scanf("%d%d",&N,&M)!=EOF; )

    {

        bool flag=1;

        For(i,1,N) u[i]=i,link[i]=0,dlt[i]=0;

        For(i,1,M)

        {

            int x,y,d;

            scanf("%d%d%d",&x,&y,&d);

            if (flag) flag=check(x,y,d);

        }

        if (flag)

            printf("Yes\n");

        else

            printf("No\n");

    }

    return 0;

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <bits/stdc++.h>



#define F first 

#define S second



using namespace std;



typedef long long LL;

typedef pair<int, int> PII;



const int N = 100010, M = 4 * N, INF = 0x3f3f3f3f;



int n, m;

int h[N], e[M], w[M], ne[M], idx;

int dist[N], q[N];



bool bfs(int u)

{

	int hh = 0, tt = -1;

	q[ ++ tt] = u;

	dist[u] = 0;

	

	while (hh <= tt)

	{

		int t = q[hh ++ ];

		for (int i = h[t]; ~i; i = ne[i])

		{

			int j = e[i];

			if (dist[j] == INF)

			{

				q[ ++ tt] = j;

				dist[j] = dist[t] + w[i];

			}

			else if (dist[j] != dist[t] + w[i]) return false;

		}

	}

	return true;

}



void add(int a, int b, int c)

{

	e[idx] = b, w[idx] = c, ne[idx] = h[a], h[a] = idx ++ ;

}



int main()

{

	memset(h, -1, sizeof h);

	scanf("%d%d", &n, &m);

	while (m -- )

	{

		int a, b, c;

		scanf("%d%d%d", &a, &b, &c);

		add(a, b, c), add(b, a, -c);

	}

	

	memset(dist, 0x3f, sizeof dist);

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

		if (dist[i] == INF && !bfs(i))

		{

			puts("No");

			return 0;

		}

	puts("Yes");

    return 0;

}

// Optimized solution to the same problem (faster):
#include <bits/stdc++.h>



#define F first 

#define S second

#define PB push_back



using namespace std;



typedef long long LL;

typedef pair<int, int> PII;

typedef priority_queue<int> HEAP;

typedef priority_queue<int, vector<int>, greater<int> > RHEAP;



const int N = 100010, M = 400010;



int n, m;

int h[N], e[M], w[M], ne[M], idx;

int q[M];

int dist[N];

bool st[N];



void add(int a, int b, int c)

{

	e[idx] = b, w[idx] = c, ne[idx] = h[a], h[a] = idx ++ ;

}



bool bfs(int u)

{

	int hh = 0, tt = -1;

	q[ ++ tt] = u;

	dist[u] = 0;

	st[u] = true;

	

	while (hh <= tt)

	{

		int t = q[hh ++ ];

		

		for (int i = h[t]; ~i; i = ne[i])

		{

			int j = e[i];

			if (!st[j])

			{

				q[ ++ tt] = j;

				st[j] = true;

				dist[j] = dist[t] + w[i];

			}

			else if (dist[j] != dist[t] + w[i]) return false;

		}

	}

	return true;

}



int main()

{

	memset(h, -1, sizeof h);

	scanf("%d%d", &n, &m);

	

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

	{

		int a, b, c;

		scanf("%d%d%d", &a, &b, &c);

		add(a, b, c), add(b, a, -c);

	}

	

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

		if (!st[i] && !bfs(i))

		{

			puts("No");

			return 0;

		}

	puts("Yes");

    return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <bits/stdc++.h>



#define F first

#define S second

#define PB push_back



using namespace std;



typedef long long LL;

typedef pair<int, int> PII;

typedef priority_queue<int> HEAP;

typedef priority_queue<int, vector<int>, greater<int> > RHEAP;



const int N = 100010, M = 4 * N, INF = 0x3f3f3f3f;



int n, m;

int h[N], e[M], w[M], ne[M], idx;

int q[N], dist[N];



void add(int a, int b, int c)

{

	e[idx] = b, w[idx] = c, ne[idx] = h[a], h[a] = idx ++ ;

}



bool bfs(int st)

{

	int hh = 0, tt = -1;

	q[ ++ tt] = st;

	dist[st] = 0;

	

	while (hh <= tt)

	{

		int t = q[hh ++ ];

		

		for (int i = h[t]; ~i; i = ne[i])

		{

			int j = e[i];

			

			if (dist[j] == INF)

			{

				dist[j] = dist[t] + w[i];

				q[ ++ tt] = j;

			}

			else if (dist[j] != dist[t] + w[i]) return false;

		}

	}

	

	return true;

}



int main()

{

	memset(h, -1, sizeof h);

	memset(dist, 0x3f, sizeof dist);

	

	scanf("%d%d", &n, &m);

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

	{

		int a, b, c;

		scanf("%d%d%d", &a, &b, &c);

		add(a, b, c), add(b, a, -c);

	}

	

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

		if (dist[i] == INF && !bfs(i))

		{

			puts("No");

			return 0;

		}

	

	puts("Yes");

	return 0;

}

// Optimized solution to the same problem (faster):
#include <bits/stdc++.h>



#define F first 

#define S second

#define PB push_back



using namespace std;



typedef long long LL;

typedef pair<int, int> PII;

typedef priority_queue<int> HEAP;

typedef priority_queue<int, vector<int>, greater<int> > RHEAP;



const int N = 100010, M = 400010;



int n, m;

int h[N], e[M], w[M], ne[M], idx;

int q[M];

int dist[N];

bool st[N];



void add(int a, int b, int c)

{

	e[idx] = b, w[idx] = c, ne[idx] = h[a], h[a] = idx ++ ;

}



bool bfs(int u)

{

	int hh = 0, tt = -1;

	q[ ++ tt] = u;

	dist[u] = 0;

	st[u] = true;

	

	while (hh <= tt)

	{

		int t = q[hh ++ ];

		

		for (int i = h[t]; ~i; i = ne[i])

		{

			int j = e[i];

			if (!st[j])

			{

				q[ ++ tt] = j;

				st[j] = true;

				dist[j] = dist[t] + w[i];

			}

			else if (dist[j] != dist[t] + w[i]) return false;

		}

	}

	return true;

}



int main()

{

	memset(h, -1, sizeof h);

	scanf("%d%d", &n, &m);

	

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

	{

		int a, b, c;

		scanf("%d%d%d", &a, &b, &c);

		add(a, b, c), add(b, a, -c);

	}

	

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

		if (!st[i] && !bfs(i))

		{

			puts("No");

			return 0;

		}

	puts("Yes");

    return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <bits/stdc++.h>



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

using namespace std;



typedef long long ll;



const int INF = 1 << 30;

const ll LLINF = 1LL << 62;



int mod = 1000000007;



struct edge{

    int to;

    ll cost;

};



vector<edge> nodes[100000];

ll zahyou[100000];



void init(){

    rep(i, 100000) zahyou[i] = -mod;

}



bool dfs(int p, int s){

    bool ret = true;

    rep(i, nodes[s].size()){

        int to = nodes[s][i].to;

        ll cost = nodes[s][i].cost;

        if(zahyou[to] == -mod){

            zahyou[to] = zahyou[s] + cost;

            ret &= dfs(s, to);

        }

        else{

            if(zahyou[to] != zahyou[s] + cost) ret = false;

        }

    }

    return ret;

}



int main(void){

    ios::sync_with_stdio(false);

    cin.tie(nullptr);

    init();

    int N, M; cin >> N >> M;

    rep(i, M){

        int l, r; ll c;

        cin >> l >> r >> c; l--; r--;

        edge e; e.cost = c; e.to = r;

        nodes[l].push_back(e);

        e.cost *= -1; e.to = l;

        nodes[r].push_back(e);

    }

    bool ok = true;

    rep(i, N){

        if(zahyou[i] == -mod){

            zahyou[i] = 0;

            ok &= dfs(-1, i);

        }

    }

    if(ok) cout << "Yes" << endl;

    else cout << "No" << endl;

    return 0;

}

// Optimized solution to the same problem (faster):
#include <bits/stdc++.h>



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

using namespace std;



typedef long long ll;



const int INF = 1 << 30;

const ll LLINF = 1LL << 62;



int mod = 1000000007;



struct edge{

    int to;

    ll cost;

};



vector<edge> nodes[100000];

int visited[100000] = {};

ll zahyou[100000];



void init(){

    rep(i, 100000) zahyou[i] = -1;

}



bool dfs(int p, int s){

    bool ret = true;

    visited[s] = true;

    rep(i, nodes[s].size()){

        int to = nodes[s][i].to;

        ll cost = nodes[s][i].cost;

        if(to == p) continue;

        if(visited[to]){

            if(zahyou[to] != zahyou[s] + cost) ret = false;

        }

        else{

            zahyou[to] = zahyou[s] + cost;

            ret &= dfs(s, to);

        }

    }

    return ret;

}



int main(void){

    ios::sync_with_stdio(false);

    cin.tie(nullptr);

    int N, M; cin >> N >> M;

    rep(i, M){

        int l, r; cin >> l >> r;

        l--; r--;

        ll d; cin >> d;

        edge e;

        e.to = r; e.cost = d;

        nodes[l].push_back(e);

        e.to = l; e.cost = -d;

        nodes[r].push_back(e);

    }



    bool res = true;

    rep(i, N){

        if(!visited[i]){

            zahyou[i] = 0;

            res &= dfs(-1, i);

        }

    }

    if(res) cout << "Yes" << endl;

    else cout << "No" << endl;

    return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <cstdio>

#include <cstring>

#include <vector>

#include <map>

#include <set>

#include <queue>

#include <deque>

#include <algorithm>

#define INF 1000000000000000LL

using namespace std;

struct edge {int to; long long int cost; };

int main()

{

	int n, m, l, r;

	long long int d, x[100000];

	scanf("%d %d", &n, &m);

	vector<edge> v[100000];

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

		scanf("%d %d %lld", &l, &r, &d);

		l--;

		r--;

		edge e;

		e.to=r, e.cost=d;

		v[l].push_back(e);

		e.to=l, e.cost=-d;

		v[r].push_back(e);

	}

	queue<int> que;

	set<int> st;

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

		x[i]=INF;

		st.insert(i);

	}

	while(!st.empty()){

		auto itr=st.begin();

		int n0=*itr;

		que.push(n0);

		x[n0]=0;

		while(!que.empty()){

			int k=que.front();

			que.pop();

			if(st.find(k)==st.end()) continue;

			st.erase(k);

			for(int i=0; i<v[k].size(); i++){

				edge e=v[k][i];

				if(x[e.to]==INF){

					x[e.to]=x[k]+e.cost;

				}else if(x[e.to]!=x[k]+e.cost){

                  printf("%s\n", "No");

					return 0;

				}

				que.push(e.to);

			}

		}

	}

	printf("%s\n", "Yes");

	return 0;

}

// Optimized solution to the same problem (faster):
#include <cstdio>

#include <cstring>

#include <iostream>

#include <string>

#include <cmath>

#include <bitset>

#include <vector>

#include <map>

#include <set>

#include <queue>

#include <deque>

#include <algorithm>



using namespace std;

typedef long long int ll;

typedef pair<int, int> P;



int par[100002];

int rk[100002];

ll dw[100002];



void init(int n){

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

		par[i]=i;

	}

}



int root(int x){

	if(par[x]==x) return x;

	int p=root(par[x]);

	dw[x]+=dw[par[x]];

	return par[x]=p;

}



ll weight(int x){

	root(x);

	return dw[x];

}



ll diff(int x, int y){

	return weight(y)-weight(x);

}



bool unite(int x, int y, ll w){

	w=w+weight(x)-weight(y);

	x=root(x); y=root(y);

	if(x==y){

		if(w!=0) return false;

	}

	if(rk[x]<rk[y]) swap(x, y), w=-w;

	if(rk[x]==rk[y]) rk[x]++;

	par[y]=x;

	dw[y]=w;

	return true;

}



int main()

{

	int n, m;

	cin>>n>>m;

	init(n);

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

		int l, r;

		ll d;

		cin>>l>>r>>d;

		l--; r--;

		if(!unite(l, r, d)){

			cout<<"No"<<endl;

			return 0;

		}

	}

	cout<<"Yes"<<endl;

	return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <iostream>

#include <vector>

using namespace std;

 

typedef long long int ll;

typedef pair<ll, ll> P;



ll INF = 1000000000000;

 

ll N, M, L[200000], R[200000], D[200000];

vector< vector<P> > G(100001);

vector<ll> num(100001);

string ans;

 

void dfs(int now){    

 

    for(int i=0;i<G[now].size();i++){

        P nextP = G[now][i];

        int nextNode = nextP.first;

        int nextCost = nextP.second;

 

        if(num[nextNode] == INF){

            num[nextNode] = num[now] + nextCost;

            dfs(nextNode);

        } else {

            if(num[nextNode] != num[now] + nextCost)  ans = "No";

        }

        

    }

}

 

int main(){

    cin >> N >> M;

    for(int i=0;i<M;i++)    cin >> L[i] >> R[i] >> D[i];

 

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

        G[ L[i] ].push_back( P(R[i], D[i]) );

        G[ R[i] ].push_back( P(L[i], -1 * D[i]) );

    }

    

    for(int i=1;i<=N;i++)   num[i] = INF;

 

    ans = "Yes";

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

        if(num[i] == INF){

            num[i] = 0;

            dfs(i);

        }

        if(ans == "No") break;

    }

 

    cout << ans << endl;

}

// Optimized solution to the same problem (faster):
#include <bits/stdc++.h>

using namespace std;



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

#define repr(i, n) for(int i = (n-1); i >= 0; --i)



template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }

template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }



typedef long long ll;

typedef pair<int, int> P;



const int MAX = 100005;

const int INF = 1001001001;

const int MOD = 1000000007;



struct edge {

    int to, cost;

    edge(int to, int cost) : to(to), cost(cost) {}

};



vector<edge> G[MAX];

vector<bool> first;



ll dp[MAX];

bool dfs(int v) {

    bool res = true;

    for (edge e : G[v]) {

        int u = e.to, d = e.cost;

        if (dp[u] < 0) {

            dp[u] = dp[v] + d;

            res &= dfs(u);

        } else {

            if (dp[u] != dp[v] + d) return false;

        }

    }

    return res;

}



//頂点の入次数を管理

int h[100010];



int main(){

    int N, M;

    cin >> N >> M;



    first.resize(N, true);



    rep(i, M) {

        int l, r, d;

        cin >> l >> r >> d;

        l--, r--;

        G[l].emplace_back(r, d);

        h[r]++;

        first[r] = false;

    }



    stack<int> st;

    rep(i, N) if (h[i] == 0) st.emplace(i);



    vector<int> res;

    while (st.size()) {

        int i = st.top(); st.pop();

        res.push_back(i);

        for (edge e : G[i]) {

            int u = e.to;

            h[u]--;

            if (h[u] == 0) st.push(u);

        }

    }



    if (res.size() != N) {

        cout << "No" << endl;

        return 0;

    }



    bool ans = true;

    rep(i, N) dp[i] = -1;



    rep(i, N) {

        if (first[i] && dp[i] < 0) {

            dp[i] = 0;

            ans &= dfs(i);

        }

        if (!ans) break;

    }



    cout << (ans? "Yes" : "No") << endl;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<bits/stdc++.h>



int n,cnt;

long long sum;



int main(){

	scanf("%d",&n);

	for(int i=1;;++i){

		if(i%2==0||i%3==0||i%5==0) printf("%d ",i), sum+=i, ++cnt;

		if(cnt==n-2) break;

	}

	sum%=30; sum+=60;

	if(sum&1){

		printf("29997 %d",30033-sum);

	}

	else{

		for(int i=5;;i+=5)

			if((sum-i)%3==0&&sum-i>=3){

				printf("%d %d",30000-i,30000-sum+i);

				break;

			}

	}

	return 0;

}

// Optimized solution to the same problem (faster):
#include<cstdio>

#include<cstring>

#include<algorithm>

#define MN 30000

using namespace std;

inline int in(){

    int x=0;bool f=0; char c;

    for (;(c=getchar())<'0'||c>'9';f=c=='-');

    for (x=c-'0';(c=getchar())>='0'&&c<='9';x=(x<<3)+(x<<1)+c-'0');

    return f?-x:x;

}

int odd[MN+5],evn[3][MN+5],n,tot,cnt;

int main()

{

	n=in();

	if (n==3) {printf("2 5 63");return 0;}

	for (int i=1;i<=MN;++i){

		if (i&1){

			if (!(i%3)) odd[++cnt]=i;

		}else {

			evn[i%3][++evn[i%3][0]]=i;

		}

	}tot=n;

	if (n&1){

		for (int i=2;i<=5000&&tot>3;i+=2){

			tot-=2;printf("%d %d ",odd[i-1],odd[i]);

		}

		for (int i=1;i<=5000&&tot>=2;++i){

			tot-=2;printf("%d %d ",evn[1][i],evn[2][i]);

		}

		for (int i=1;i<=5000&&tot;++i){

			--tot;printf("%d ",evn[0][i]);

		}

	}else{

		for (int i=2;i<=5000&&tot>2;i+=2){

			tot-=2;printf("%d %d ",odd[i-1],odd[i]);

		}

		for (int i=1;i<=5000&&tot>=2;++i){

			tot-=2;printf("%d %d ",evn[1][i],evn[2][i]);

		}

		for (int i=1;i<=5000&&tot;++i){

			--tot;printf("%d ",evn[0][i]);

		}

	}return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <bits/stdc++.h>

using namespace std;

int pr[30002],n,i,vis[30002];

int main(){

	

	vector <int> v;

	int sum=0;

	cin>>n;

	if(n==3){

		cout<<"2 5 63"<<endl;

		return 0;

	}

	for(i=30000;i>=2;i=i-2){

		if(n>2){

			v.push_back(i);

			vis[i]=1;

			n--;

			sum+=i;

			if(i==8 && n%2==0 && sum%3==0)

			break;

			if(i==6 && n%2==0 && sum%3==0)

			break;

			if(i==4 && n%2==0 && sum%3==0)

			break;

		}

		else

		break;

	}

	int j=3;

	while(n){

		if(sum%j==0 && vis[j]==0){

			for(i=j;i<30000 && n!=0 ;i=i+j)

				if(vis[i]==0 && i%2==1){

					v.push_back(i);

					vis[i]=1;

					n--;

					sum+=i;

				}

		}

		j=j+2;

	}

	for(i=0;i<v.size();i++)

		cout<<v[i]<<endl;

}

// Optimized solution to the same problem (faster):
#include<cstdio>

#include<algorithm>

#include<cstring>

#define MN 30005

using namespace std;

int n,num,ans[MN];

int main(){

	scanf("%d",&n);

	if(n==3){puts("2 5 63");}

	else {

		ans[++num]=2;ans[++num]=4;

		for(int i=6;num+2<=n&&i+3<=30000;i+=12)ans[++num]=i-3,ans[++num]=i+3;

		for(int i=6;num+2<=n&&i+4<=30000;i+=6)ans[++num]=i+2,ans[++num]=i+4;

		for(int i=6;num+1<=n&&i<=30000;i+=6)ans[++num]=i;

		for(int i=1;i<=num;i++)printf("%d ",ans[i]);

	}

}




// Fastest known solution for this problem:
// Original C++ solution (slower):
# include <bits/stdc++.h>



using namespace std;



int n, u[30005];

vector <int> ans;



int main(){

      cin >> n;



      if(n == 3){

            cout << "2 5 63";

            return 0;

      }



      int odd = 15;



      ans.push_back(3);

      ans.push_back(9);

      n -= 2;

      if(n % 3 == 1){

            n -= 2;

            ans.push_back(15);

            ans.push_back(21);

            odd = 27;

      }



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

            if(n > 0){

                  ans.push_back(i);

                  n --;

            }

      }



      if(n % 2){

            n ++;

            ans.pop_back();

      }



      while(n > 0){

            ans.push_back(odd);

            ans.push_back(odd + 6);

            odd += 12;

            n -= 2;

      }



      for(auto i : ans)

            cout << i << " ";

}


// Optimized solution to the same problem (faster):
#include<cstdio>

#include<algorithm>

#include<cstring>

#define MN 30005

using namespace std;

int n,num,ans[MN];

int main(){

	scanf("%d",&n);

	if(n==3){puts("2 5 63");}

	else {

		ans[++num]=2;ans[++num]=4;

		for(int i=6;num+2<=n&&i+3<=30000;i+=12)ans[++num]=i-3,ans[++num]=i+3;

		for(int i=6;num+2<=n&&i+4<=30000;i+=6)ans[++num]=i+2,ans[++num]=i+4;

		for(int i=6;num+1<=n&&i<=30000;i+=6)ans[++num]=i;

		for(int i=1;i<=num;i++)printf("%d ",ans[i]);

	}

}




// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <bits/stdc++.h>

using namespace std;

int pr[30002],n,i,vis[30002];

int main(){

	

	vector <int> v;

	int sum=0;

	cin>>n;

	if(n==3){

		cout<<"2 5 63"<<endl;

		return 0;

	}

	for(i=30000;i>=2;i=i-2){

		if(n>2){

			v.push_back(i);

			vis[i]=1;

			n--;

			sum+=i;

			

			if(i==12 && n%2==0 && sum%3==0)

			break;

			if(i==10 && n%2==0 && sum%3==0)

			break;

			if(i==8 && n%2==0 && sum%3==0)

			break;

			if(i==6 && n%2==0 && sum%3==0)

			break;

			if(i==4 && n%2==0 && sum%3==0)

			break;

		}

		else

		break;

	}

	int j=3;

	while(n){

		if(sum%j==0 && vis[j]==0){

			for(i=j;i<30000 && n!=0 ;i=i+j)

				if(vis[i]==0 && i%2==1){

					v.push_back(i);

					vis[i]=1;

					n--;

					sum+=i;

				}

		}

		j=j+2;

	}

	for(i=0;i<v.size();i++)

		cout<<v[i]<<endl;

}

// Optimized solution to the same problem (faster):
#include<cstdio>

#include<algorithm>

#define MAXN 20006

using namespace std;

int a[MAXN],cnt,n;

int main()

{

	scanf("%d",&n);

	if(n==3)

	{

		printf("2 5 63");

		return 0;

	}

	cnt=4;

	n-=4;

	a[1]=3;

	a[2]=9;

	a[3]=2;

	a[4]=4;

	while(n>=2&&a[cnt]+6<=30000)

	{

		n-=2;

		cnt++;

		a[cnt]=a[cnt-1]+4;

		cnt++;

		a[cnt]=a[cnt-1]+2;

	}

	while(n>=2&&(a[cnt]%2==0||a[cnt]+4*3<=30000))

	{

		n-=2;

		cnt++;

		if(a[cnt-1]%2==0) a[cnt]=15;

		else a[cnt]=a[cnt-1]+6;

		cnt++;

		a[cnt]=a[cnt-1]+6;

	}

	while(n>=1&&(a[cnt]%6!=0||a[cnt]+6<=30000))

	{

		n--;

		cnt++;

		if(a[cnt-1]%6!=0) a[cnt]=6;

		else a[cnt]=a[cnt-1]+6;

	}

	sort(a+1,a+1+cnt);

	for(int i=1;i<=cnt;i++)

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

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<iostream>

#include<string>

using namespace std;

int main()

{

    int a,b;

    char c;

    cin>>a>>c>>b;

    if(c=='-')

    cout<<a-b;

    else

    cout<<a+b;

    system("pause");

    }


// Optimized solution to the same problem (faster):
#include <cstdio>

int main()

{

	

	int a = 0,b = 0;

	char c;

	scanf ("%d %c %d",&a,&c,&b);

	switch (c){

		case '+':printf ("%d",a + b);break;

		case '-':printf ("%d",a - b);

		}

	return 0;

	}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <iostream>

using namespace std;

int main(){

int a,b,sum=0;

char h;

cin>>a>>h>>b;

if(h=='+'){

    sum=a+b;

}

if(h=='-'){

    sum=a-b;

}

    cout<<sum<<endl;

    return 0;

}


// Optimized solution to the same problem (faster):
#include <cstdio>

int main()

{

	

	int a = 0,b = 0;

	char c;

	scanf ("%d %c %d",&a,&c,&b);

	switch (c){

		case '+':printf ("%d",a + b);break;

		case '-':printf ("%d",a - b);

		}

	return 0;

	}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<iostream>

#include<cstdio>

#include<cstring>

using namespace std;



int n,m,dp[5][10010];

char a;

bool ans;



int main()

{

	int i;

	cin>>n>>a>>m;

	if(a=='+') cout<<n+m;

	else cout<<n-m;

}

// Optimized solution to the same problem (faster):
#include <cstdio>

int main()

{

	

	int a = 0,b = 0;

	char c;

	scanf ("%d %c %d",&a,&c,&b);

	switch (c){

		case '+':printf ("%d",a + b);break;

		case '-':printf ("%d",a - b);

		}

	return 0;

	}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<bits/stdc++.h>

using namespace std ;

long long a , b , ans ;

char c ;

int main()

{

	cin >> a >> c >> b ;

	if ( c=='-' ) 

		cout << a-b ;

	else

		cout <<  a+ b ;



}

// Optimized solution to the same problem (faster):
#include <cstdio>

int main()

{

	

	int a = 0,b = 0;

	char c;

	scanf ("%d %c %d",&a,&c,&b);

	switch (c){

		case '+':printf ("%d",a + b);break;

		case '-':printf ("%d",a - b);

		}

	return 0;

	}

// Fastest known solution for this problem: