The Python implementation should follow basically the same code that we use in `misol.js`.
The Python implementation should follow basically the same code that we use in
misol.js.