A=matrix(QQ, [[1,1,1,6],[1,-2,1,0],[-1,2,1,6]]) print('The matrix A is:') A print('The reduced row echelon form of the matrix A is:') A.rref()