#include <iostream>
#include <stack>
using namespace std;

int main() {
    //类比为括号匹配问题
    stack<char> s;
    char y;
    bool z = true;
    while (cin >> y)
    {
        if (y == 'a') s.push(y);
        else        
        {
            if (s.empty()) z = false;
            else if (s.top() != 'a') z = false;
            else s.pop();
        }
    }
    if (!s.empty()) z = false;
    if (z) cout << "Good";
    else cout << "Bad";
    return 0;
}
// 64 位输出请用 printf("%lld")