Solution for Problem 6.