add problem 8 to python, php, and ruby