Solve problem #22.