write matrix as a product of elementary matrices