/*
#include<stdio.h>
int main() {
int k,s=0;
char op,bop='+';
for(;;) {
scanf("%d%c",&k,&op);
if(bop=='+') {
s=s+k;
bop = op;
} else if(bop=='-') {
s=s-k;
bop =op;
} else if(bop=='*') {
s=s*k;
bop =op;
} else if(bop=='/') {
s=s/k;
bop =op;
}
if(op=='=') {
break;
}
}
printf("%d",s);
}
*/
********주식 이어하기
#include<stdio.h>
int main()
{
int m,d,p,i,s;
scanf("%d %d",&m,&d);
for(i=0; i<d; i++){
scanf("%d",&p);
s=m;
s=s+s/p;
}
printf("%d",s-m);
if(m>s){
printf("bad");
}
else if(m<s){
printf("good");
}
else {
printf("same");
}
}