#include<iostream> #include<string> using namespace std; int main(){ string a,b ; long m,n; m=1;n=1; cin>>a>>b; for(int i = 0 ; i < a.length(); i++) { m *= (a[i] - 64); m = m % 47; } for(int i = 0 ; i < b.length(); i++) { n *= (b[i] - 64); n = n % 47; } if(m % 47 == n % 47) { cout<<"GO"<<endl; cout<<"r1=r2="<<m%47<<endl; } else { cout<<"STAY"<<endl; cout<<"r1="<<m%47<<" r2="<<n%47<<endl; } //cout<<m<<" "<<n<<endl; return 0; }