USACO - ride

Give two strings UFO and Comet. Each alphabet in a string is converted
to an integer and all the integers of a string are multiplied. If their
integer value mod 47 is same for both the strings, then write GO in the
output file or else write STAY.