solve frog on both row woods problem