Solve problem 82 using Python.