Solve problem #21.