Proquint implementation in Python