I,R,O=input,range,print J=lambda:map(int,I().split()) S=I() T=I() U={"watermelon","beachball","shrinebell"} U.remove(S) U.remove(T) O(U.pop())