problem 005 solution