Solve the second problem