#include #include
using namespace std;
string s,t;
int calc(string s){ int res = 1; for (int i=0;i < s.length(); i++) res *= s[i] -'A' + 1; return res % 47; }
int main(){ cin >> s >> t;
if ( calc(s) == calc(t) ) cout << "GO"; else cout << "STAY";
}
By signing up a HFOJ universal account, you can submit code and join discussions in all online judging services provided by us.
Using your HFOJ universal account