Input: Cats and dogs can be pals
cats and fish can be pals

Output: second