Solution for the problem 10