Problem 0007 solution.