#include<bits/stdc++.h>
using namespace std;
main(){
int n[9],m,a,i; string s;
while(cin>>s){
for(i=0;i<9;i++) n[i]=s[i]-48;
a=n[6]*100+n[7]*10+n[8];
sort(n,n+9);
m=n[7]*n[7]+n[8]*n[8];
if(a==m) cout<<"Good Morning!\n";
else cout<<"SPY!\n";
}
}