Cryptarithmetic Problem Python Code