Solve problem 91 using Python.