Problem 0006 solution.