Solutions for problem 3.