inverse matrix 3x3 python without numpy