#include <stdio.h>
#include<string.h>
#include<stdbool.h>
int main() {
    char a[100005];
    bool yes=true;
    scanf("%s",a);
    int top=0;
    int m=strlen(a);
    char stack[10005];
    for(int i=0;i<m;i++){
        if(a[i]=='a'){
            stack[top++]=a[i];
        }
        else if(a[i]=='b'){
            if(top==0||stack[top-1]!='a'){
                yes=false;
                break;
            }
            top--;
        }
    }
    if(top!=0){
        yes=false;
    }
    if(yes){
        printf("Good\n");
    }
    else{
        printf("Bad");
    }


    return 0;
}