A man was on one side of a river with a bag of corn, a duck, and a fox. He needed to get to the other side of the river, but he could only carry 1 item at a time with him when crossing. He couldn't leave the corn and the duck alone because the duck would eat the corn. He couldn't leave the duck and the fox alone because the fox would eat the duck. How did he get all 3 across the river?