A farmer is standing on one bank of a river, with a fox, a chicken, and a bag of grain.
He needs to get to the other side of the river, taking the fox, the chicken, and the grain with him.
However, the boat used to cross the river is only large enough to carry the farmer and one of the things he needs to take with him, so he will need to make several trips in order to get everything across.
In addition, he cannot leave the fox unattended with the chicken, or else the fox will eat the chicken; and he cannot leave the chicken unattended with the grain, or else the chicken will eat the grain.
The fox is not particularly partial to grain and may be left alone with it.
How can the farmer get everything across the river without anything being eaten?