def PrintMatrix(mat): for i in mat: print(' '.join(str(j) for j in i))