Assignment task:
Once upon a time a farmer went to a market and purchased a fox, a goose, and a bag of beans. On his way home, the farmer came to the bank of a river and rented a boat. But in crossing the river by boat, the farmer could carry only himself and a single one of his purchases: the fox, the goose, or the bag of beans.
If left unattended together, the fox would eat the goose, or the goose would eat the beans.
The farmer's challenge was to carry himself and his purchases to the far bank of the river, leaving each purchase intact. How did he do it? Give the optimal solution (minimum number of steps).