Solving all combinations generation