Solution for second problem.