#include <bits/stdc++.h>
#define ull unsigned long long
#define ll long long
#define el endl
using namespace std;
void input()
{
    if (fopen("in.txt", "r"))
    {
        freopen("in.txt", "r", stdin);
        freopen("out.txt", "w", stdout);
    }
}
int main()
{
Fast:
    input();
    //---------------------------------" " UPSOLVE---------------------------------------------------------------

    int t;
    cin >> t;

    while (t--)
    {
        string s;
        cin >> s;
        bool xst = false;
        for (int i = 0; i < s.size()-2; i++)
        {
             if (  (s[i]==1 && s[i+1]==0 && s[i+2]==1)
             ||    (s[i]==0 && s[i+1]==1 && s[i+2]==0) ) xst = true;
                   
             
            
        }
        if(xst = true)
            cout << "Good"<<el;
        else if(xst = false)
            cout << "Bad"<<el;
    }

    return 0;
}
