a=set(["watermelon","beachball","shrinebell"]) st=set([input(),input()]) print(str(a-st)[2:-2])