#include <stdio.h>
#include<string.h>
int main() {
char s[100002];
char stack[100001];
int top=0;
scanf("%s",s);
for(int i=0;s[i]!='\0';i++){
if(s[i]=='b'&&top>0&&stack[top-1]=='a'){
top--;
}
else{
stack[top++]=s[i];
}
}
if(top==0) printf("Good\n");
else printf("Bad\n");
return 0;
}

京公网安备 11010502036488号