Chinese Remainder Theorem in Python