#9 solution