Beware: the greatest variable is usually the first variable.
The value returned is a list {monoms, coeff}. Let x_i be the smallest index variable that occurs in the j-th column of m. Then the j-th column of coeff contains the (vector) coefficient of the highest power of this variable, and the j-th element of monoms is the highest power x_i^n.