#include<bits/stdc++.h>
using namespace std;
int main()
{
bool p=true;
int a,b=0,d=0;
cin>>a;
for(int i=0;i<a;i++)
{
if(a%i==0)
{
d=i;
b+=i;
if(d!=b)
{
p=false;
}
}
}
if(p) cout<<"Good!";
else cout<<"Bad!";
return 0;
}
这是代码。