fix structure_dynprog_modular for Python3