Make karatsuba algorithm compatible with python3.x