usaco1

/*
ID:marco
LANG:C++
TASK:ride
*/
#include<bits/stdc++.h>
using namespace std;
int a[1010],b[1010],n,n1,n2;
string x,y;

int main(){
freopen("ride.in","r",stdin);
freopen("ride.out","w",stdout);
char ch;
int i,ans1=1,ans2=1;
cin>>x>>y;
n1=x.length();
n2=y.length();
for(int i=0;i<=n1-1;i++)
ans1*=int(x[i])-64;
for(int i=0;i<=n2-1;i++)
ans2*=int(y[i])-64;
ans1%=47;
ans2%=47;
if(ans1==ans2)
cout<<"GO\n";
else
cout<<"STAY\n";
}

posted @ 2017-03-07 18:33  _Koreyoshi  阅读(110)  评论(0编辑  收藏  举报