Problem 29

Python 2.7