A man has three animals on a riverbank: a dog, a cat, and a mouse. The man needs to get all three animals to the other side of the river, but his raft can only carry himself and one animal at a time The man cannot leave the dog and cat together because the dog wil eat the cat. Similarly, if the man leaves the cat and mouse together, the cat will eat the mouse. Help the man figure out a system for transporting each of the animals across the river without any of them getting eaten.
