Solve #54 with Python.