Add solution for problem 16.