solve returns self if !all_solutions