Solution to the exercise.