/*
Author : Vivek Hamirwasia
 
A programmer started to cuss,
Because getting to sleep was a fuss.
As he lay there in bed,
Looping around in his head,
Was: while(!asleep()) sheep++;
 
 */
 
// Solution for problem code : ERROR
 
#include<cstdio>
#include<iostream>
#include<vector>
#include<map>
#include<set>
#include<stack>
#include<queue>
#include<algorithm>
#include<cmath>
#include<string>
#include<cstdlib>
#include<climits>
#include<cstring>
using namespace std;
 
#define CLR(a,x) memset(a,x,sizeof(a))
#define PB push_back
#define INF 1000000000
#define MOD 1000000007
#define MP make_pair
#define tr(container , it) for(typeof(container.begin()) it=container.begin() ; it!=container.end() ; it++)
#define FOR(i,a,b) for(i=a;i<b;i++)
#define REP(i,a) FOR(i,0,a)
#define LLD long long
#define VI vector < int >
#define PII pair < int , int >
#define MAX 1000000000
char str[1000000];
int main()
{
    int t;
    scanf("%d",&t);
    while(t--)
    {
	scanf("%s",str);
	int len = strlen(str);
 
	bool f = 0;
	for(int i=0;i<len-2;i++)
	{
	    if(str[i]=='0' && str[i+1]=='1' && str[i+2]=='0' || str[i] == '1' && str[i+1] == '0' && str[i+2] == '1')
	    {
		f=1;
		break;
	    }
	}
 
	if(f)
	    printf("Good\n");
	else
	    printf("Bad\n");
    }
 
    return 0;
}