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

using namespace std;



int main()

{

    int n,x;

    int cnt=0,cnt2=0,cnt4=0;

    cin>>n;

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

    {

        cin>>x;

        if(x%4==0)

            cnt4++;

        else if(x%2==0)

            cnt2++;

    }

    cnt=n-cnt2-cnt4;

//    cout<<cnt<<" "<<cnt2<<" "<<cnt4<<endl;

    if(cnt2)

    {

        if(cnt4>=cnt)

            cout<<"Yes"<<endl;

        else

            cout<<"No"<<endl;

    }

    else if(cnt4&&cnt4+1>=cnt)

        cout<<"Yes"<<endl;

    else

        cout<<"No"<<endl;

    return 0;

}


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

#define MAXN 100005



int main ()

{

	int n;

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

	{

		int n1 = 0, n2 = 0, n3 = 0;

		int a;

		while(n--)

		{

			scanf("%d", &a);

			if(a%4 == 0)n1++;

			else if(a%2 == 0)n2++;

			else n3++;

		}

		if((n3 - 1 > n1) || n3 - 1 == n1 && n2)

		printf("No\n");

		else printf("Yes\n");

	}

	return 0;

}

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

using namespace std;

int ara[1000000];

char ara1[1000000];

int main()

{

    int i,j,k,l,n,ln,t,df,v=0,sum,fl=0;

    long long gun=1;

    scanf("%d",&n);

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

    {

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

        if(ara[i]%4==0)

        {

            fl++;

        }

        else if(ara[i]%2==0)

        {

            v++;

        }

    }

    v/=2;

    t=n/2;

    fl+=v;

    if(fl<t)

    {

        printf("No\n");

    }

    else

    {

        printf("Yes\n");

    }

    return 0;

}


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

#define MAXN 100005



int main ()

{

	int n;

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

	{

		int n1 = 0, n2 = 0, n3 = 0;

		int a;

		while(n--)

		{

			scanf("%d", &a);

			if(a%4 == 0)n1++;

			else if(a%2 == 0)n2++;

			else n3++;

		}

		if((n3 - 1 > n1) || n3 - 1 == n1 && n2)

		printf("No\n");

		else printf("Yes\n");

	}

	return 0;

}

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

#define N 100020

#define ll long long

using namespace std;

inline int read(){

	int x=0,f=1;char ch=getchar();

	while(ch>'9'||ch<'0')ch=='-'&&(f=0)||(ch=getchar());

	while(ch<='9'&&ch>='0')x=(x<<3)+(x<<1)+ch-'0',ch=getchar();

	return f?x:-x;

}

int cnt2, cnt4;

int main(int argc, char const *argv[]) {

	int n = read();

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

		int x = read();

		if (x % 4 == 0) cnt4 ++;

		else if (x % 2 == 0) cnt2 ++;

	}

	if (cnt4 * 2 + (cnt2 ? cnt2 : 1) >= n) puts("Yes");

	else puts("No");

	return 0;

}


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

#define MAXN 100005



int main ()

{

	int n;

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

	{

		int n1 = 0, n2 = 0, n3 = 0;

		int a;

		while(n--)

		{

			scanf("%d", &a);

			if(a%4 == 0)n1++;

			else if(a%2 == 0)n2++;

			else n3++;

		}

		if((n3 - 1 > n1) || n3 - 1 == n1 && n2)

		printf("No\n");

		else printf("Yes\n");

	}

	return 0;

}

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

#include <algorithm>

using namespace std;



const int N = 1e5 + 5;



int n, a[N], cc[N], p[5];



int main() {

	ios::sync_with_stdio(false);

	cin >> n;

	int cnt = 0;

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

		cin >> a[i];

		for (int t = a[i], cnt = 0; t % 2 == 0 && t; cc[i] = ++cnt, t /= 2)

			;

		cc[i] = min(cc[i], 2);

	}

	sort(cc + 1, cc + n + 1);

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

		++p[cc[i]];

	if (p[0] <= p[2])

		cout << "Yes" << endl;

	else if (p[0] == p[2] + 1 && !p[1])

		cout << "Yes" << endl;

	else

		cout << "No" << endl;

	return 0;

}

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

#define MAXN 100005



int main ()

{

	int n;

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

	{

		int n1 = 0, n2 = 0, n3 = 0;

		int a;

		while(n--)

		{

			scanf("%d", &a);

			if(a%4 == 0)n1++;

			else if(a%2 == 0)n2++;

			else n3++;

		}

		if((n3 - 1 > n1) || n3 - 1 == n1 && n2)

		printf("No\n");

		else printf("Yes\n");

	}

	return 0;

}

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

using namespace std;

int n;

int main()

{

	ios::sync_with_stdio(0);

	cin>>n;int a1=0,a2=0,a4=0;

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

		int x;cin>>x;

		if(x%4==0)a4++;

		else if(x%2==0)a2++;

		else a1++;

	}

	if(a2==0&&a4>=a1-1)puts("Yes");

	else{

		if(a4>=a1)puts("Yes");

		else puts("No");

	}

	return 0;

}

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

#define MAXN 100005



int main ()

{

	int n;

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

	{

		int n1 = 0, n2 = 0, n3 = 0;

		int a;

		while(n--)

		{

			scanf("%d", &a);

			if(a%4 == 0)n1++;

			else if(a%2 == 0)n2++;

			else n3++;

		}

		if((n3 - 1 > n1) || n3 - 1 == n1 && n2)

		printf("No\n");

		else printf("Yes\n");

	}

	return 0;

}

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

using namespace std;

int n;

int main()

{

	cin>>n;int a1=0,a2=0,a4=0;

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

	{

		int x;cin>>x;

		if(x%4==0)a4++;

		else if(x%2==0)a2++;

		else a1++;

	}

	if(a2==0&&a4>=a1-1)puts("Yes");

		else

		{

			if(a4>=a1)puts("Yes");

			else puts("No");

		}

	return 0;

}

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

#define MAXN 100005



int main ()

{

	int n;

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

	{

		int n1 = 0, n2 = 0, n3 = 0;

		int a;

		while(n--)

		{

			scanf("%d", &a);

			if(a%4 == 0)n1++;

			else if(a%2 == 0)n2++;

			else n3++;

		}

		if((n3 - 1 > n1) || n3 - 1 == n1 && n2)

		printf("No\n");

		else printf("Yes\n");

	}

	return 0;

}

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

#include<iostream>

#include<algorithm>

#include<math.h>

#include<stdlib.h>

#include<string.h>

#include<string>

#include<set>

#include<vector>

#include<bitset>

#include<map>

#define N 100005

#define ll long long

#define oo 100000000

#define For(i,x,y) for(int i=x;i<=y;i++)

#define Rep(i,x,y) for(int i=x;i>=y;i--)

#define Forn(i,x,y) for(int i=x;i<y;i++)

using namespace std;

inline int read(){int x=0,f=0;char ch=getchar();for(;ch<'0'||ch>'9';ch=getchar()) if(ch=='-') f=1;for(;ch>='0'&&ch<='9';ch=getchar()) x=(x<<1)+(x<<3)+ch-48;return f?-x:x;}

inline void write(ll x){if(x<10) putchar(x+48);else write(x/10),putchar(x%10+48);}

inline void writeln(ll x){if(x<0) putchar('-'),x=-x;write(x);putchar('\n');}

int n,a[N],p[4];

int main(){

	n=read();For(i,1,n) a[i]=read();

	For(i,1,n){

		if(a[i]%4==0) p[0]++;

		else if(a[i]%2==0) p[1]++;

		else p[2]++;

	}

	if(p[1]==0){

		if(p[0]+1>=p[2]) puts("Yes");

		else puts("No");

	}else{

		if(p[0]>=p[2]) puts("Yes");

		else puts("No");

	}

	return 0;

}

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

#define MAXN 100005



int main ()

{

	int n;

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

	{

		int n1 = 0, n2 = 0, n3 = 0;

		int a;

		while(n--)

		{

			scanf("%d", &a);

			if(a%4 == 0)n1++;

			else if(a%2 == 0)n2++;

			else n3++;

		}

		if((n3 - 1 > n1) || n3 - 1 == n1 && n2)

		printf("No\n");

		else printf("Yes\n");

	}

	return 0;

}

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

using namespace std;



int main()

{

	int num, sequence,MOD1=0,MOD2=0,MOD4=0;

	cin >> num;

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

	{

		cin >> sequence;

		if (sequence % 4 == 0) MOD4++;

		else if (sequence % 2 == 0) MOD2++;

		else MOD1++;

	} 

	if (MOD1>MOD4 + 1 || (MOD1 == MOD4 + 1 && MOD2 != 0)) 

		cout<<"No"<<endl;

	else 

		cout<<"Yes"<<endl;

	

	return 0;

}


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

#define MAXN 100005



int main ()

{

	int n;

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

	{

		int n1 = 0, n2 = 0, n3 = 0;

		int a;

		while(n--)

		{

			scanf("%d", &a);

			if(a%4 == 0)n1++;

			else if(a%2 == 0)n2++;

			else n3++;

		}

		if((n3 - 1 > n1) || n3 - 1 == n1 && n2)

		printf("No\n");

		else printf("Yes\n");

	}

	return 0;

}

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



using namespace std;



typedef long long ll;

typedef unsigned long long ull;

typedef pair<int, int> pii;

typedef vector<int> vi;

typedef vector<ll> vll;

typedef set<int> si;



int main()

{

    ios::sync_with_stdio(false);

    cin.tie(0);

    cout.tie(0);

    int n;

    int t;

    map<int, int> m;

    cin >> n;

    while (n--)

    {

        cin >> t;

        if (t % 4 == 0)

            m[4]++;

        else if (t & 1)

            m[1]++;

        else

            m[2]++;

    }

    if (m[1] <= m[4] || (m[1] <= m[4] + 1 && !m[2]))

        cout << "Yes" << endl;

    else

        cout << "No" << endl;

    return 0;

}

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

#define MAXN 100005



int main ()

{

	int n;

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

	{

		int n1 = 0, n2 = 0, n3 = 0;

		int a;

		while(n--)

		{

			scanf("%d", &a);

			if(a%4 == 0)n1++;

			else if(a%2 == 0)n2++;

			else n3++;

		}

		if((n3 - 1 > n1) || n3 - 1 == n1 && n2)

		printf("No\n");

		else printf("Yes\n");

	}

	return 0;

}

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

#include<iostream>  

#include<stdio.h>  

#include<cmath>  

using namespace std;

int n, a[100005], b[5];

int main() 

{

	cin >> n;

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

		cin >> a[i];

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

	{

		if (a[i] & 1)

		{ 

			b[1]++; 

			continue;

		}

		if (a[i] % 4 == 0) 

			b[4]++;

		else if 

			(a[i] % 2 == 0) b[2]++;

	}

	if (!b[2] && b[1] > b[4] + 1)

	{

		printf("No");

		return 0;

	}

	if (b[2] && b[1] > b[4])

	{

		printf("No");

		return 0;

	}

	printf("Yes");

	return 0;

}

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

#define MAXN 100005



int main ()

{

	int n;

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

	{

		int n1 = 0, n2 = 0, n3 = 0;

		int a;

		while(n--)

		{

			scanf("%d", &a);

			if(a%4 == 0)n1++;

			else if(a%2 == 0)n2++;

			else n3++;

		}

		if((n3 - 1 > n1) || n3 - 1 == n1 && n2)

		printf("No\n");

		else printf("Yes\n");

	}

	return 0;

}

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

using namespace std;   

int a,b,c,x,n;

    int main()

    {

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

        {

            a=b=c=0;

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

            {

                scanf("%d",&x);

                if(!(x%4)) a++;

                else if(x&1) b++;

                else c++;

            }

            if(!c) b--;

            puts(a>=b?"Yes":"No");

        }

        return 0;

    }

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

#define MAXN 100005



int main ()

{

	int n;

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

	{

		int n1 = 0, n2 = 0, n3 = 0;

		int a;

		while(n--)

		{

			scanf("%d", &a);

			if(a%4 == 0)n1++;

			else if(a%2 == 0)n2++;

			else n3++;

		}

		if((n3 - 1 > n1) || n3 - 1 == n1 && n2)

		printf("No\n");

		else printf("Yes\n");

	}

	return 0;

}

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

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

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

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

#define pb push_back

#define mp make_pair

#define sz(A) ((int)A.size())

#define vi vector<int>

#define vl vector<long long>

#define vd vector<double>

#define vp vector<pair<int,int> >

#define ll long long

#define pi pair<int,int>

#define popcnt(x) __builtin_popcount(x)

#define LSOne(x) ((x) & (-(x)))

#define xx first

#define yy second

#define PQ priority_queue

#define print(A,t) cerr << #A << ": "; copy(all(A),ostream_iterator<t>(cerr," " )); cerr << endl

#define prp(p) cerr << "(" << (p).first << " ," << (p).second << ")";

#define prArr(A,n,t)  cerr << #A << ": "; copy(A,A + n,ostream_iterator<t>(cerr," " )); cerr << endl

#define PRESTDIO() cin.tie(0),cerr.tie(0),ios_base::sync_with_stdio(0)

#define what_is(x) cerr << #x << " is " << x << endl

#define bit_lg(x) (assert(x > 0),__builtin_ffsll(x) - 1)

const double PI = acos(-1);

using namespace std;



int cnt[4];

int A[1 << 20];



int main(){

	int n,x; scanf("%d",&n);

	loop(i,n) {

		scanf("%d",&x);

		cnt[x%4]++;

	}

	memset(A,-1,sizeof A);

	for(int i = 1;i < n && cnt[0];i += 2,cnt[0]--)

		A[i] = 0;

	for(int i = 0;i < n && cnt[1] + cnt[3];i += 2)

		if(cnt[1]) A[i] = 1,cnt[1]--;

		else A[i] = 3,cnt[3]--;

	for(int i = n-1;i >= 0 && cnt[2];i--)

		if(A[i] == -1){

			A[i] = 2;

			cnt[2]--;

		}

	loop(i,n-1) if((A[i] * A[i+1])%4) {

		puts("No");

		return 0;

	}

	puts("Yes");

	return 0;

}


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

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

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

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

#define pb push_back

#define mp make_pair

#define sz(A) ((int)A.size())

#define vi vector<int>

#define vl vector<long long>

#define vd vector<double>

#define vp vector<pair<int,int> >

#define ll long long

#define pi pair<int,int>

#define popcnt(x) __builtin_popcount(x)

#define LSOne(x) ((x) & (-(x)))

#define xx first

#define yy second

#define PQ priority_queue

#define print(A,t) cerr << #A << ": "; copy(all(A),ostream_iterator<t>(cerr," " )); cerr << endl

#define prp(p) cerr << "(" << (p).first << " ," << (p).second << ")";

#define prArr(A,n,t)  cerr << #A << ": "; copy(A,A + n,ostream_iterator<t>(cerr," " )); cerr << endl

#define PRESTDIO() cin.tie(0),cerr.tie(0),ios_base::sync_with_stdio(0)

#define what_is(x) cerr << #x << " is " << x << endl

#define bit_lg(x) (assert(x > 0),__builtin_ffsll(x) - 1)

const double PI = acos(-1);

using namespace std;

 

int cnt[4];

int A[1 << 20];

 

int main(){



	int n,x; scanf("%d",&n);

	loop(i,n) {

		scanf("%d",&x);

		cnt[x%4]++;

	}

	if(cnt[1] + cnt[2] + cnt[3] <= cnt[0] + 1) puts("Yes");

	else if(cnt[1] + cnt[3] <= cnt[0]) puts("Yes");

	else puts("No");

	return 0;

}

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

#include <cstring>

#include <iostream>

#include <string>

#include <cmath>

#include <bitset>

#include <vector>

#include <map>

#include <set>

#include <queue>

#include <deque>

#include <algorithm>

#include <complex>

#include <unordered_map>

#include <unordered_set>

#include <random>

#include <cassert>

#include <fstream>

#define popcount __builtin_popcount

using namespace std;

typedef long long int ll;

typedef pair<int, int> P;



int main()

{

    int n, m; cin>>n>>m;

    int q; cin>>q;

    int a[100010];

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

        cin>>a[i];

    }

    int ind[100010];

    fill(ind, ind+m+1, -1);

    int c=0;

    vector<int> v[100010];

    for(int i=q-1; i>=0; i--){

        if(ind[a[i]]==-1){

            ind[a[i]]=c;

            v[0].push_back(a[i]);

            c++;

        }else{

            int l=0, r=n;

            while(r-l>1){

                int mid=(l+r)/2;

                if(v[mid].size()<=ind[a[i]]) r=mid;

                else l=mid;

            }

            if(r<n && v[r].size()==ind[a[i]]){

                v[r].push_back(a[i]);

            }

        }

    }

    for(int i=1; i<=m; i++) if(ind[i]==-1) v[0].push_back(i);

    int mn=0;

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

        if(v[0][i]<v[0][i-1]){

            mn=i; break;

        }

    }

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

        if(v[i].size()<mn){

            cout<<"No"<<endl; return 0;

        }

    }

    cout<<"Yes"<<endl;

    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>

#include <complex>

#include <unordered_map>

#include <unordered_set>

#include <random>

#include <cassert>

#include <fstream>

#define popcount __builtin_popcount

using namespace std;

typedef long long int ll;

typedef pair<int, int> P;



int main()

{

    int n, m; cin>>n>>m;

    int q; cin>>q;

    int a[100010];

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

        cin>>a[i];

    }

    int ind[100010];

    fill(ind, ind+m+1, -1);

    int cnt[100010]={};

    vector<int> v;

    for(int i=q-1; i>=0; i--){

        if(ind[a[i]]==-1){

            ind[a[i]]=cnt[0];

            v.push_back(a[i]);

            cnt[0]++;

        }else{

            int l=0, r=n;

            while(r-l>1){

                int mid=(l+r)/2;

                if(cnt[mid]<=ind[a[i]]) r=mid;

                else l=mid;

            }

            if(r<n && cnt[r]==ind[a[i]]) cnt[r]++;

        }

    }

    for(int i=1; i<=m; i++) if(ind[i]==-1) v.push_back(i);

    int mn=0;

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

        if(v[i]<v[i-1]){

            mn=i; break;

        }

    }

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

        if(cnt[i]<mn){

            cout<<"No"<<endl; return 0;

        }

    }

    cout<<"Yes"<<endl;

    return 0;

}

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

#define si(a) scanf("%d",&a)

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

#define sorte(a) sort(a.begin(), a.end())

using namespace std;

typedef long long ll;

typedef vector<int> vi;

typedef pair<int,int> pi;

int main(){

	char s[5];

	scanf("%s",s);

	if(s[0]==s[1] || s[1]==s[2] ||s[2]==s[3])

		printf("Bad\n");

	else

		printf("Good\n");

	return 0;

}

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

int main()

{

	char a[4];

	scanf("%s",a);

	bool flag=1;

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

	{

		if(a[i]==a[i+1])

		{

			flag=0;

			break;

		}

	}

	if(flag)

	{

		printf("Good\n");

	}

	else

	{

		printf("Bad\n");

	}

}

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

#include <algorithm>

using namespace std;



int main()

{

	string s;

	while (cin >> s) {

		if (s[0] == s[1] || s[1] == s[2] || s[2] == s[3])

			cout << "Bad\n";

		else cout << "Good\n";

	}

}

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

int main()

{

	char a[4];

	scanf("%s",a);

	bool flag=1;

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

	{

		if(a[i]==a[i+1])

		{

			flag=0;

			break;

		}

	}

	if(flag)

	{

		printf("Good\n");

	}

	else

	{

		printf("Bad\n");

	}

}

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

using namespace std;



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

#define reps(i,n) for(int i=1;i<=(n);++i)

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

#define step(i,s,n,c) for(int i=(s);i<(n);i+=(c))

#define REP(i,s,n) for(int i=(s);i<(n);++i)

#define each(i,vec) for(auto i:vec)

#define cinv(n,vec) VL vec(n);for(auto&v:vec)cin>>v;

#define int long long

#define itn int

#define pb push_back

#define eb emplace_back

#define m_p make_pair

#define m_t make_tuple

#define p_p(a,b) pb(m_p(a,b))

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

#define SORT(a) sort(all(a))

#define RSORT(a) sort(all(a),greater<>())

#define UNIQUE(a) a.erase(unique(all(a)),a.end())

#define SZ(a) (signed)(a.size())

#define debg(a) cout<<#a<<" "<<a<<endl;

#define debgp(a) cout<<#a<<" "<<a.fi<<" : "<<a.se<<endl

#define call(a) for(auto i:a)cout<<i<<" ";cout<<endl

#define callp(a) for(auto [k,v]:a)cout<<k<<":"<<v<<endl

#define show(a) for(cont &y:a){for(cont &x:y){cout<<x<<" ";}cout<<endl;}

#define out(a) cout<<(a)<<endl

#define ENDL cout<<endl

#define YES cout<<"YES"<<endl

#define NO cout<<"NO"<<endl

#define Yes cout<<"Yes"<<endl

#define No cout<<"No"<<endl

#define fi first

#define se second

#define V vector

#define P pair

#define T tuple

#define PQ priority_queue

#define cont const auto

#define VV(type,name,y,x,a) vector<vector<type>> name = vector<vector<type>>(y,vector<type>(x,a))

typedef long long ll;

typedef double D;

typedef long double LD;

typedef string str;

typedef vector<ll> VL;

typedef pair<ll,ll> PL;

typedef vector<pair<ll,ll>> VP;

typedef tuple<ll,ll,ll> T3;

typedef tuple<ll,ll,ll,ll> T4;

const signed INF = (1LL<<30);

const long long MOD = (1e9+7);

const long long LINF = (1LL<<60);

const long long LMAX = LLONG_MAX;

void YN(bool b){cout<<(b?"Yes":"No")<<endl;}

template<class T>inline T gcd(T a,T b){if(b==0)return a; return(gcd(b,a%b));}

template<class T>inline T lcm(T a,T b){return a/gcd(a,b)*b;}

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

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



signed main(){

  cin.tie(0);

  ios::sync_with_stdio(false);

  cout<<fixed<<setprecision(10);

  

  str s;

  cin>>s;

  bool a=true;

  if(s[0]==s[1])a=false;

  if(s[1]==s[2])a=false;

  if(s[2]==s[3])a=false;

  out(a?"Good":"Bad");

  

  

  return 0;

}

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

int main(){

  char a,b,c,d;

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

  if( a==b || b==c || c==d )printf("Bad\n");

  else printf("Good\n");



  return 0;

}

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

#include <ext/pb_ds/detail/standard_policies.hpp>

#define int long long

#define double long double

#define endl "\n"

#define fastio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);

#define pb(x) push_back(x)

#define mp(a,b) make_pair(a,b)

#define ms(v,x) memset(v,x,sizeof(v))

#define pii pair<int,int>

#define ff first

#define ss second

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

#define td(v) v.begin(),v.end()

#define inf 1000000000 // 1e9

#define M   1000000007 // 1e9 + 7

using namespace std;

inline int mod(int n, int m){ int ret = n%m; if(ret < 0) ret += m; return ret; }

int gcd(int a, int b){return (b == 0 ? a : gcd(b, a%b));}

int lcm(int a,int b){return (a*b)/gcd(a,b);}

int exp(int a,int b,int m){

    if(b==0) return 1;

    if(b==1) return mod(a,m);

    int k = mod(exp(a,b/2,m),m);

    if(b&1){

        return mod(a*mod(k*k,m),m);

    }

    else return mod(k*k,m);

}

main(){

    fastio;

    string s;

	cin >> s;

	if(s[0] == s[1] || s[1]==s[2] || s[2]==s[3]){

		cout << "Bad\n";

	}

	else cout << "Good\n";

    

}


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

int main()

{

	int n=4;

	char a[4];

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

	{

		scanf("%c",&a[i]);

	}

	if(a[0]==a[1]||a[1]==a[2]||a[2]==a[3])

	{

		printf("Bad");

	}

	else

	{

		printf("Good");

	}

}

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

#define int long long

using namespace std;



int32_t main(){

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

	string n;

	cin >> n;

    for(int i = 0; i < n.size()-1; ++i){

        if(n[i] == n[i+1]){

            cout << "Bad\n";

            return 0;

        }

    }

    cout << "Good\n";

}

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

int main()

{

	int n=4;

	char a[4];

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

	{

		scanf("%c",&a[i]);

	}

	if(a[0]==a[1]||a[1]==a[2]||a[2]==a[3])

	{

		printf("Bad");

	}

	else

	{

		printf("Good");

	}

}

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

#include <cstdio>

#include <map>

using namespace std;

map<char,int> arrs;

char arr[5];

int main(){

	scanf("%s",&arr);

	int s=1;

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

		if(arr[i]==arr[i-1]){

			s=0;

			break;

		}

	}

	if(s){

		cout<<"Good"<<endl;

	}else{

		cout<<"Bad"<<endl;

	}

	return 0;

} 

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

int main()

{

	int n=4;

	char a[4];

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

	{

		scanf("%c",&a[i]);

	}

	if(a[0]==a[1]||a[1]==a[2]||a[2]==a[3])

	{

		printf("Bad");

	}

	else

	{

		printf("Good");

	}

}

// Fastest known solution for this problem: