write out adj matrices.