#include<bits/stdc++.h>
using namespace std;
int main(){
stack<char> st;
string s;
int a,b;
cin>>s;
for( char c:s){
if(c=='a'){
st.push(c);
}
else if(c=='b') {
if(!st.empty()&&st.top()=='a'){
st.pop();
}
else {
cout<<"Bad";
return 0;
}
}
}
if(st.empty()){
cout<<"Good";
}else {
cout<<"Bad";
}
return 0;
}

京公网安备 11010502036488号