Input: people love cookies
cookies love people

Output: second