river crossing problem solution