We calculate the Smith Normal Form of the matrix M by row and column operations.
> m:=matrix(3,3,[[1,3,4],[-1,2,4],[5,2,1]]);
> det(m);
> m:=addrow(m,3,2,-4);
> m:=addrow(m,3,1,-4);
> m:=addcol(m,3,2,-2);
> m:=addcol(m,3,1,-5);
> m:=addrow(m,2,1,-1);
> m:=addrow(m,1,2,6);
> m:=swaprow(m,1,2);
> m:=addcol(m,2,1,-2);
Now change the sign on -9 and move it to the bottom corner for strict SNF.
>