analysis and solution of the goats, wolves, lions problem