multiplying 3 matrices in python