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

using namespace std;



int main(){



	int x;



	cin >> x;



	for (int i = 1; x != 0; i++){

		cout << "Case " << i << ": " << x << endl;

		cin >> x;

	}



	return 0;

}

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



int main(){

	

	int x;



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



		scanf("%d", &x);



		if (x == 0) return 0;



		printf("Case %d: %d\n", i, x);

	}



	return 0;

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

#include <string>

#include <algorithm>

#include <cmath>

#include <cstdlib>

#include <vector>



using namespace std;

#define rep(i, s, e) for (int(i) = (s); (i) < (e); (i)++)



int main()

{

	int a, b, c, x, y, cost, ans;

	cin >> a >> b >> c >> x >> y;

	ans = a*x + b*y;

	rep(i, 0, 100001)

	{

		cost = c * i * 2 + a * max(0, x - i) + b * max(0, y - i);

		ans = min(ans, cost);

	}

	cout << ans << endl;

}


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

#include <string>

#include <algorithm>

#include <cmath>

#include <cstdlib>

#include <vector>

#include <map>

#include <queue> 

#include <stack>

#include <set>

#include <list>



using namespace std;

typedef long long ll;

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

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





int main()

{

   ll a,b,c,x,y;

    cin>>a>>b>>c>>x>>y;

    ll z=max(x,y);

    ll res = 1e18;

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

    	ll tmp = c*i*2 + max(0LL,(x-i)*a)+max(0LL, (y-i)*b);

    	res=min(res,tmp);

    }

    cout<<res<<endl;

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

#include<algorithm>

#include<math.h>

#include<vector>

#include<map>

#include<set>



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

#define rrep(i, a, n) for (int i = a; i <= (n); ++i)



using namespace std;

using ll = long long;

using ull = unsigned long long;



int main() {

    int A; cin >> A;

    int B; cin >> B;

    int C; cin >> C;

    int X; cin >> X;

    int Y; cin >> Y;



    int min_price = 1 << 30;

    rrep(i, 0, 100000) {

        int price = 2 * C * i; // ABピザは2枚で2C円の1セットと考える

        int a = X - i; // A ピザの枚数

        int b = Y - i; // A ピザの枚数

        if (a > 0) price += A * a; // A ピザが足りなければ買い足す

        if (b > 0) price += B * b; // B ピザが足りなければ買い足す

        min_price = min(min_price, price);

    }



    cout << min_price << endl;

    return 0;

}


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

#include<algorithm>

#include<math.h>

#include<vector>

#include<map>

#include<set>



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

#define rrep(i, a, n) for (int i = a; i <= (n); ++i)



using namespace std;

using ll = long long;

using ull = unsigned long long;



int main() {

    int A; cin >> A;

    int B; cin >> B;

    int C; cin >> C;

    int X; cin >> X;

    int Y; cin >> Y;



    int min_price = 1 << 30;

    rrep(i, 0, max(X, Y)) {

        int price = 2 * C * i + max(0, A * (X - i)) + max(0, B * (Y - i));

        min_price = min(min_price, price);

    }



    cout << min_price << endl;

    return 0;

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

 

using namespace std;

 

int n, p[200005], in[200005], ta, tb;

set< int > s[200005];

vector< int > x, y;

bool v[200005];

 

void go(int a) {

	v[a] = 1;

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

		if (s[a].find(i) == s[a].end()) {

			s[p[a]].insert(i);

			break;

		}

	in[p[a]]--;

	if (in[p[a]] == 0)

		go(p[a]);

}

 

int main() {

	scanf("%d", &n);

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

		scanf("%d", p + i);

		in[p[i]]++;

	}

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

		if (!in[i] && !v[i])

			go(i);

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

		if (!v[i]) {

			ta = i;

			while (1) {

				x.push_back(ta);

				if (p[ta] == i)

					break;

				ta = p[ta];

			}

			break;

		}

	for (int i = 0; y.size() < 2; i++)

		if (s[x[0]].find(i) == s[x[0]].end())

			y.push_back(i);

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

		in[0] = y[i];

		for (int j = 1; j < x.size(); j++)

			for (int k = 0; ; k++)

				if (in[j - 1] != k && s[x[j]].find(k) == s[x[j]].end()) {

					in[j] = k;

					break;

				}

		if (i == 0 && in[x.size() - 1] != y[0]) {

			printf("POSSIBLE\n");

			return 0;

		}

		if (i == 1 && in[x.size() - 1] == y[0]) {

			printf("POSSIBLE\n");

			return 0;

		}

	}

	printf("IMPOSSIBLE\n");

	return 0;

}

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

using namespace std;

const int N=2050000;

inline int rd(register int x=0,register char ch=getchar(),register int f=0){

	for(;!isdigit(ch);ch=getchar()) f=ch=='-';

	for(;isdigit(ch);ch=getchar()) x=(x<<1)+(x<<3)+ch-48;

	return f?-x:x;

}

int n,B;

int head[N],to[N<<1],nxt[N<<1],sta[N],vis[N],a[N],al[N];

vector<int> scc;



void lnk(int x,int y){

	to[++B]=y,nxt[B]=head[x],head[x]=B;

}

void dfs(int x,int prt){

	if(vis[x]){

		//printf("-> %d %d %d %d\n",x,prt,vis[x],sta[0]);

		for(int i=vis[x];i<=sta[0];++i) scc.push_back(sta[i]);

		return;

	}

	sta[++sta[0]]=x,vis[x]=sta[0];

	for(int i=head[x];i;i=nxt[i]) if(to[i]!=prt) dfs(to[i],x);

	vis[x]=0;--sta[0];

}

void DFS(int x,int prt){

	for(int i=head[x];i;i=nxt[i]) if(to[i]!=prt&&!vis[to[i]]) DFS(to[i],x);

	for(int i=head[x];i;i=nxt[i]) if(to[i]!=prt&&!vis[to[i]]) al[a[to[i]]]=1;

	while(al[a[x]]) ++a[x];

	for(int i=head[x];i;i=nxt[i]) if(to[i]!=prt&&!vis[to[i]]) al[a[to[i]]]=0;

}

int main(){

	n=rd();

	for(int i=1;i<=n;++i) lnk(rd(),i);

	for(int i=1;i<=n;++i) if(!scc.size()) dfs(i,0);

	for(auto x:scc) vis[x]=1;

	for(auto x:scc) DFS(x,0);

	int mx=-n-100,mn=n+100;

	for(auto x:scc) mx=max(mx,a[x]),mn=min(mn,a[x]);

	puts((mx==mn&&scc.size()%2!=0)?"IMPOSSIBLE":"POSSIBLE");

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

#include <set>

using namespace std;

const int N=200005;

int n,pre[N],cnex[N];

int h[N],tot;

struct Edge{

	int v,next;

}e[N*2];

int a[N],len,mex[N][2];

inline void addEdge(int u,int v){

	e[++tot]=(Edge){v,h[u]}; h[u]=tot;

}

void readData(){

	scanf("%d",&n);

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

		scanf("%d",&pre[i]);		

		addEdge(pre[i],i);

	}

}

void findCircle(int u){

	static int stk[N],top=0;

	static bool vis[N];

	stk[++top]=u;

	vis[u]=true;

	if(vis[pre[u]]){

		int v=pre[u];

		cnex[v]=u;

		for(;stk[top]!=v;top--){

			cnex[stk[top]]=stk[top-1];

			a[++len]=stk[top];

		}

		a[++len]=v;

		return;

	}

	findCircle(pre[u]);

}

void dfs(int u,int dep){

	for(int i=h[u],v;i;i=e[i].next)

		if((v=e[i].v)!=cnex[u])

			dfs(v,dep+1);

	multiset<int> s;

	s.clear();

	for(int i=h[u],v;i;i=e[i].next)

		if((v=e[i].v)!=cnex[u])

			s.insert(mex[v][0]);

	for(mex[u][0]=0;s.find(mex[u][0])!=s.end();mex[u][0]++);

	if(dep==0)

		for(mex[u][1]=mex[u][0]+1;s.find(mex[u][1])!=s.end();mex[u][1]++);

}

bool run(int x){

	int last=x;

	for(int i=len-1;i>=1;i--){

		int u=a[i];

		last=(mex[u][0]==last)?mex[u][1]:mex[u][0];

	}

	last=(mex[a[len]][0]==last)?mex[a[len]][1]:mex[a[len]][0];

	return x==last;

}

bool judge(){

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

		dfs(a[i],0);

	return run(mex[a[len]][0])||run(mex[a[len]][1]);

}

int main(){

	readData();

	findCircle(1);

	puts(judge()?"POSSIBLE":"IMPOSSIBLE");

	return 0;

}

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

using namespace std;

const int N=200005;

int n,pre[N],cnex[N];

int h[N],tot;

struct Edge{

	int v,next;

}e[N*2];

int a[N],len,mex[N][2];

inline void addEdge(int u,int v){

	e[++tot]=(Edge){v,h[u]}; h[u]=tot;

}

void readData(){

	scanf("%d",&n);

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

		scanf("%d",&pre[i]);

		addEdge(pre[i],i); 

	}

}

void findCircle(int u){

	static int stk[N],top=0;

	static bool vis[N];

	stk[++top]=u;

	vis[u]=true;

	if(vis[pre[u]]){

		int v=pre[u];

		cnex[v]=u;

		for(;stk[top]!=v;top--){

			cnex[stk[top]]=stk[top-1];

			a[++len]=stk[top];

		}

		a[++len]=v;

		return;

	}

	findCircle(pre[u]);

}

void dfs(int u,int dep){

	for(int i=h[u],v;i;i=e[i].next)

		if((v=e[i].v)!=cnex[u])

			dfs(v,dep+1);

	static int cnt[N];

	for(int i=h[u],v;i;i=e[i].next)

		if((v=e[i].v)!=cnex[u])

			cnt[mex[v][0]]++;

	for(mex[u][0]=0;cnt[mex[u][0]];mex[u][0]++);

	if(dep==0)

		for(mex[u][1]=mex[u][0]+1;cnt[mex[u][1]];mex[u][1]++);

	for(int i=h[u],v;i;i=e[i].next)

		if((v=e[i].v)!=cnex[u])

			cnt[mex[v][0]]--;

}

bool run(int x){

	int last=x;

	for(int i=len-1;i>=1;i--){

		int u=a[i];

		last=(mex[u][0]==last)?mex[u][1]:mex[u][0];

	}

	last=(mex[a[len]][0]==last)?mex[a[len]][1]:mex[a[len]][0];

	return x==last;

}

bool judge(){

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

		dfs(a[i],0);

	return run(mex[a[len]][0])||run(mex[a[len]][1]);

}

int main(){

	readData();

	findCircle(1);

	puts(judge()?"POSSIBLE":"IMPOSSIBLE");

	return 0;

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

#include <iostream>

#include <cstdlib>

#include <cstring>

#include <cstdio>

#include <vector>

#define N 200011

using namespace std;

int ti,All[N],siz,tot,indexx[N],dp[N],vist[N],hashh[N],n,fa[N],cir[N],cnt;

vector<int> V[N];

struct apple{

	int v,nxt;

}edge[N*4];

void addedge(int x,int y){

	edge[++tot].v=y;

	edge[tot].nxt=indexx[x];

	indexx[x]=tot;

}

void dfs(int u,int f){

	int t=indexx[u],vv;

	while(t){

		vv=edge[t].v;

		if(!cir[vv] || vv==f){

			dfs(vv,u);

			V[u].push_back(dp[vv]);

		}

		t=edge[t].nxt;

	}

	ti++;

	int len=V[u].size();

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

		hashh[V[u][i]]=ti;

	}

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

		if(hashh[i]!=ti){

			dp[u]=i;

			break;

		}

	}

}

int main(){

	scanf("%d",&n);

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

		scanf("%d",&fa[i]);

		addedge(fa[i],i);

	}

	int x=1;

	while(1){

		if(vist[x]) break;

		vist[x]=1;

		x=fa[x];

	}

	memset(vist,0,sizeof(vist));

	int u=x;

	while(1){

		if(cir[u]) break;

		cir[u]=1;

		cnt++;

		u=fa[u];

	}

	if(cnt%2==0){

		printf("POSSIBLE");

		return 0;

	}

	u=x;

	while(1){

		if(vist[u]) break;

		vist[u]=1;

		dfs(u,0);

		All[++siz]=dp[u];

		u=fa[u];

	}

	sort(All+1,All+siz+1);

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

		if(All[i]!=All[i+1]){

			printf("POSSIBLE");

			return 0;

		}

	}

	printf("IMPOSSIBLE");

	return 0;

}

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

using namespace std;

#define int long long

inline int read()

{

    int f=1,w=0;char x=0;

    while(x<'0'||x>'9') {if(x=='-') f=-1; x=getchar();}

    while(x!=EOF&&x>='0'&&x<='9') {w=(w<<3)+(w<<1)+(x^48);x=getchar();}

    return w*f;

}

const int N=200010;

const int INF=1e18;

int num_edge,n,Cnt;

int Cir[N],Vis[N],Val[N];

int head[N<<1],fa[N],Jud[N];

struct Edge{int next,to;} edge[N<<1];

inline void Add(int from,int to)

{

	edge[++num_edge].next=head[from];

	edge[num_edge].to=to;

	head[from]=num_edge;

}

inline void Dfs(int pos)

{

	for(int i=head[pos];i;i=edge[i].next)

		if(!Cir[edge[i].to]) Dfs(edge[i].to);

	for(int i=head[pos];i;i=edge[i].next)

		if(!Cir[edge[i].to]) Jud[Val[edge[i].to]]=1;

	for(;Jud[Val[pos]];Val[pos]++);

	for(int i=head[pos];i;i=edge[i].next)

		if(!Cir[edge[i].to]) Jud[Val[edge[i].to]]=0;

}

main(){

	int pos=1;n=read();

	for(int i=1;i<=n;i++) fa[i]=read(),Add(fa[i],i);

	for(;!Vis[pos];pos=fa[pos]) Vis[pos]=1;

	for(;!Cir[pos];pos=fa[pos]) Cir[pos]=1;

	int Max=-1,Min=INF;

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

		if(Cir[i]) Cnt++,Dfs(i),Max=max(Max,Val[i]),Min=min(Min,Val[i]);

	if(Max==Min&&Cnt&1) puts("IMPOSSIBLE");

	else puts("POSSIBLE");

}
// Slower C++ solution:
// Code by ajcxsu

// Problem: namori grundy



#include<bits/stdc++.h>

using namespace std;



const int N=2e5+10;

int h[N], to[N], nexp[N], p=1;

inline void ins(int a, int b) { nexp[p]=h[a], h[a]=p, to[p]=b, p++; }



char tak[N], vis[N], viis[N];

int mex[N], smex[N], cir[N], nd[N], fa[N], idx, flag;

void dfs2(int x) {

    int siz=0;

    for(int u=h[x];u;u=nexp[u])

        if(!cir[to[u]]) dfs2(to[u]), ++siz;

    fill(tak, tak+siz+5, 0);

    for(int u=h[x];u;u=nexp[u])

        if(!cir[to[u]]) tak[mex[to[u]]]=1;

    for(mex[x]=0;tak[mex[x]];mex[x]++);

    for(smex[x]=mex[x]+1;tak[smex[x]];smex[x]++);

}



int rm[N];



int main() {

    ios::sync_with_stdio(false), cin.tie(0);

    int n;

    cin>>n;

    int u;

    for(int i=1;i<=n;i++) cin>>fa[i], ins(fa[i], i);

    int na=1, rt;

    while(!vis[na]) vis[na]=1, na=fa[na];

    rt=na;

    do { cir[na]=++idx, nd[idx]=na, na=fa[na]; } while(rt!=na);

    for(int i=1;i<=idx;i++) dfs2(nd[i]);

    rm[1]=mex[nd[1]];

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

        rm[i]=(rm[i-1]==mex[nd[i]]?smex[nd[i]]:mex[nd[i]]);

    if(rm[idx]!=rm[1]) cout<<"POSSIBLE"<<endl, exit(0);

    rm[1]=smex[nd[1]];

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

        rm[i]=(rm[i-1]==mex[nd[i]]?smex[nd[i]]:mex[nd[i]]);

    // for(int i=1;i<=idx;i++) cout<<mex[i]<<" \n"[i==idx];

    if(rm[idx]==mex[nd[1]]) cout<<"POSSIBLE"<<endl;

    else cout<<"IMPOSSIBLE"<<endl;

    return 0;

}


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

#include<cstring>

#include<algorithm>

using namespace std;

const int N = 200050;

template<typename T>

inline void read(T&x)

{

	T f = 1,c = 0;char ch=getchar();

	while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=getchar();}

	while(ch>='0'&&ch<='9'){c=c*10+ch-'0';ch=getchar();}

	x = f*c;

}

int n,fa[N],hed[N],cnt;

struct EG

{

	int to,nxt;

}e[N];

void ae(int f,int t)

{

	e[++cnt].to = t;

	e[cnt].nxt = hed[f];

	hed[f] = cnt;

}

bool cir[N];

int sta[N],tl;

void get_cir()

{

	int u = 1;

	while(!cir[u])cir[u]=1,u=fa[u];

	memset(cir,0,sizeof(cir));

	while(!cir[u])sta[++tl]=u,cir[u]=1,u=fa[u];

}

int sg[N];

int vis[N],tim;

void dfs(int u)

{

	for(int j=hed[u];j;j=e[j].nxt)

	{

		int to = e[j].to;

		if(!cir[to])dfs(to);

	}

	tim++;

	for(int j=hed[u];j;j=e[j].nxt)

	{

		int to = e[j].to;

		if(!cir[to])vis[sg[to]]=tim;

	}

	sg[u]=0;

	while(vis[sg[u]]==tim)sg[u]++;

}

int main()

{

	read(n);

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

	{

		read(fa[i]);

		ae(fa[i],i);

	}

	get_cir();

	int mx = -1,mn = n+1;

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

		dfs(sta[i]),mx=max(mx,sg[sta[i]]),mn=min(mn,sg[sta[i]]);

	if(mx==mn&&(tl&1))puts("IMPOSSIBLE");

	else puts("POSSIBLE");

	return 0;

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

#include <vector>

#include <cstring>

#include <iostream>

#include <algorithm>

using namespace std;

const int maxn = 200005;

int n, fa[maxn], sg[maxn], pos = 1, tot, maxi = -1, mini = 0x3f3f3f3f;

bool vis[maxn], bucket[maxn];

vector<int> e[maxn];

void dfs(int u) {

	for(auto v : e[u]) 

		if(!vis[v]) dfs(v);

	for(auto v : e[u])

		if(!vis[v]) bucket[sg[v]] = true;

	while(bucket[sg[u]]) ++sg[u];

	for(auto v : e[u])

		if(!vis[v]) bucket[sg[v]] = false;

}

int main() {

	ios :: sync_with_stdio(false);

	cin >> n;

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

		cin >> fa[i], e[fa[i]].push_back(i);

	while(!vis[pos]) vis[pos] = true, pos = fa[pos];

	memset(vis, 0, sizeof vis);

	while(!vis[pos]) vis[pos] = true, pos = fa[pos], ++tot;

	if(tot & 1) for(int i = 1; i <= n; ++i)

		if(vis[i]) dfs(i), maxi = max(maxi, sg[i]), mini = min(mini, sg[i]);

	puts(tot & 1 and maxi == mini ? "IMPOSSIBLE" : "POSSIBLE");

}

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

using namespace std;

#define int long long

inline int read()

{

    int f=1,w=0;char x=0;

    while(x<'0'||x>'9') {if(x=='-') f=-1; x=getchar();}

    while(x!=EOF&&x>='0'&&x<='9') {w=(w<<3)+(w<<1)+(x^48);x=getchar();}

    return w*f;

}

const int N=200010;

const int INF=1e18;

int num_edge,n,Cnt;

int Cir[N],Vis[N],Val[N];

int head[N<<1],fa[N],Jud[N];

struct Edge{int next,to;} edge[N<<1];

inline void Add(int from,int to)

{

	edge[++num_edge].next=head[from];

	edge[num_edge].to=to;

	head[from]=num_edge;

}

inline void Dfs(int pos)

{

	for(int i=head[pos];i;i=edge[i].next)

		if(!Cir[edge[i].to]) Dfs(edge[i].to);

	for(int i=head[pos];i;i=edge[i].next)

		if(!Cir[edge[i].to]) Jud[Val[edge[i].to]]=1;

	for(;Jud[Val[pos]];Val[pos]++);

	for(int i=head[pos];i;i=edge[i].next)

		if(!Cir[edge[i].to]) Jud[Val[edge[i].to]]=0;

}

main(){

	int pos=1;n=read();

	for(int i=1;i<=n;i++) fa[i]=read(),Add(fa[i],i);

	for(;!Vis[pos];pos=fa[pos]) Vis[pos]=1;

	for(;!Cir[pos];pos=fa[pos]) Cir[pos]=1;

	int Max=-1,Min=INF;

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

		if(Cir[i]) Cnt++,Dfs(i),Max=max(Max,Val[i]),Min=min(Min,Val[i]);

	if(Max==Min&&Cnt&1) puts("IMPOSSIBLE");

	else puts("POSSIBLE");

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

#include <cstdio>

#include <cstdlib>

using namespace std;



int ExGCD(int a, int b, int &x, int &y){

    int d=a;

    x=1; y=0;

    if(b!=0){ d=ExGCD(b, a%b, y, x); y-=a/b*x; }

    return d;

}



int main(){

    int n;

    cin >> n;

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

        int a,b;

        cin >> a >> b;

        int x,y,d;

        d = ExGCD(a, b, x, y);

        if(d <= 50000){

            printf("3\n0 0\n%d %d\n%d %d\n", a, b, abs(y), abs(x));

        }else{

            printf("4\n0 0\n%d %d\n%d %d\n%d %d\n", a-1, b, a/d, b/d, a, b-1);

        }

    }

    return 0;

}




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

#include <cstdlib>

using namespace std;



int ExGCD(int a, int b, int &x, int &y){

    int d=a;

    x=1; y=0;

    if(b!=0){ d=ExGCD(b, a%b, y, x); y-=a/b*x; }

    return d;

}



int main(){

    int n;

    scanf("%d", &n);

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

        int a,b;

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

        int x,y,d;

        d = ExGCD(a, b, x, y);

        if(d <= 50000){

            printf("3\n0 0\n%d %d\n%d %d\n", a, b, abs(y), abs(x));

        }else{

            printf("4\n0 0\n%d %d\n%d %d\n%d %d\n", a-1, b, a/d, b/d, a, b-1);

        }

    }

    return 0;

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

using namespace std;

int main()

{

    int a,b;

    while(cin>>a>>b)

    {

        if(a==b) cout<<"Yes"<<endl;

        else if((a==4 || a==6 || a==9 || a==11) && (a==b || b==6 || b==9 || b==11))

            cout<<"Yes"<<endl;

        else if((a==1 || a==3 || a==5 || a==7 || a==8 || a==10 || a==12) && (b==1 || b==3 || b==5 || b==7 || b==8 || b==10 || b==12))

            cout<<"Yes"<<endl;

        else cout<<"No"<<endl;

    }

    return 0;

}

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

#include<stdlib.h>

int main()

{

	int x,y;

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

	int days[12] = { 31,28,31,30,31,30,31,31,30,31,30,31 };

	if (days[x - 1] == days[y - 1])

	{

		printf("Yes\n");

	}

	else

	{

		printf("No\n");

	}

	system("pause");

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

#include<stdio.h>

using namespace std;

int main()

{

    int a,b;

    while(scanf("%d%d",&a,&b)==2)

    {

        if(a==b)

            printf("Yes\n");

        else if((a==4 || a==6 || a==9 || a==11) && (b==4 || b==6 || b==9 || b==11))

            printf("Yes\n");

         else if((a==1 || a==3 || a==5 || a==7 || a==10|| a==8 || a==12) && (b==1 || b==3 || b==5 || b==7 || b==8|| b==10 || b==12))

            printf("Yes\n");

            else printf("No\n");

    }

    return 0;

}


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

#include<stdlib.h>

int main()

{

	int x,y;

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

	int days[12] = { 31,28,31,30,31,30,31,31,30,31,30,31 };

	if (days[x - 1] == days[y - 1])

	{

		printf("Yes\n");

	}

	else

	{

		printf("No\n");

	}

	system("pause");

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

using namespace std;



int main() {

	int x, y, grupx, grupy;

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

	if(x == 2) grupx = 1;

		else if(x == 4 || x == 6 || x == 9 || x == 11) grupx = 2;

		else grupx = 3;

	if(y == 2) grupy = 1;

		else if(y == 4 || y == 6 || y == 9 || y == 11) grupy = 2;

		else grupy = 3;

	if(grupy == grupx) printf("Yes");

	else printf("No");

}

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

#include <stdlib.h>



int main()

{

    int a,b;

    while(~scanf("%d %d",&a,&b))

    {

        if(a==2||b==2||a==11||a==12)

        {

            printf("No\n");

        }

        else

        {

           if((a==1||a==3||a==5||a==7||a==8||a==10)&&(b==4||b==6||b==9||b==11))

            printf("No\n");

           else if((b==1||b==3||b==5||b==7||b==8||b==10||b==12)&&(a==4||a==6||a==9))

            printf("No\n");

            else

            printf("Yes\n");

        }

    }



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

using namespace std;



int x,y,gx,gy;



int main(){

    cin>>x>>y;

    if(x==2){

        gx=1;

    }else if((x==4)||(x==6)||(x==9)||(x==11)){

        gx=2;

    }else{

        gx=3;

    }



    if(y==2){

        gy=1;

    }else if((y==4)||(y==6)||(y==9)||(y==11)){

        gy=2;

    }else{

        gy=3;

    }



    if(gx==gy){

        cout<<"Yes"<<endl;

    }else{

        cout<<"No"<<endl;

    }

}

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

#include <stdlib.h>



int main()

{

    int a,b;

    while(~scanf("%d %d",&a,&b))

    {

        if(a==2||b==2||a==11||a==12)

        {

            printf("No\n");

        }

        else

        {

           if((a==1||a==3||a==5||a==7||a==8||a==10)&&(b==4||b==6||b==9||b==11))

            printf("No\n");

           else if((b==1||b==3||b==5||b==7||b==8||b==10||b==12)&&(a==4||a==6||a==9))

            printf("No\n");

            else

            printf("Yes\n");

        }

    }



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

using namespace std;



int main() {

	int x, y, grupx, grupy;

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

	if(x == 2) grupx = 1;

		else if(x == 4 || x == 6 || x == 9 || x == 11) grupx = 2;

		else grupx = 3;

	if(y == 2) grupy = 1;

		else if(y == 4 || y == 6 || y == 9 || y == 11) grupy = 2;

		else grupy = 3;

	if(grupy == grupx) printf("Yes");

	else printf("No");

}

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

#include <stdlib.h>



int main()

{

    int s[7]={1,3,5,7,8,10,12};

    int t[4]={4,6,9,11};

    int i,j,x,y,a,b;

    while(~scanf("%d %d",&x,&y))

    {

        a=0,b=0;

        for(i=0;i<7;i++)

        {

            if(x==s[i]||y==s[i])

            {

                a++;

            }

        }

        for(j=0;j<4;j++)

        {

            if(x==t[j]||y==t[j])

            {

                b++;

            }

        }

        if(a==2||b==2)

        {

            printf("Yes\n");

        }

        else if(x==y)

        {

            printf("Yes\n");

        }

        else

        {

            printf("No\n");

        }

    }

    return 0;

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

using namespace std;



int x,y,gx,gy;



int main(){

    cin>>x>>y;

    if(x==2){

        gx=1;

    }else if((x==4)||(x==6)||(x==9)||(x==11)){

        gx=2;

    }else{

        gx=3;

    }



    if(y==2){

        gy=1;

    }else if((y==4)||(y==6)||(y==9)||(y==11)){

        gy=2;

    }else{

        gy=3;

    }



    if(gx==gy){

        cout<<"Yes"<<endl;

    }else{

        cout<<"No"<<endl;

    }

}

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

#include <stdlib.h>



int main()

{

    int s[7]={1,3,5,7,8,10,12};

    int t[4]={4,6,9,11};

    int i,j,x,y,a,b;

    while(~scanf("%d %d",&x,&y))

    {

        a=0,b=0;

        for(i=0;i<7;i++)

        {

            if(x==s[i]||y==s[i])

            {

                a++;

            }

        }

        for(j=0;j<4;j++)

        {

            if(x==t[j]||y==t[j])

            {

                b++;

            }

        }

        if(a==2||b==2)

        {

            printf("Yes\n");

        }

        else if(x==y)

        {

            printf("Yes\n");

        }

        else

        {

            printf("No\n");

        }

    }

    return 0;

}