Ps = {{1,0,0,0,0},
{0,1,0,0,0},
{0, 0, s^2(s+1),s (s+2),-s},
{0,0,0, s+2,1},
{0,0,0,-1,0}}

{Sq,{Uq,Vq}} = PolynomialSmithForm[Ps,s];

Sq//MatrixForm

PsTU = {{1,0,0,0,0},
{0,1,0,0,0},
{0, 0, s^2(s+1),s (s+2),-s},
{0,0,0, s+2,1}};

{SqTU,{UqTU,VqTU}} = PolynomialSmithForm[PsTU,s];

SqTU//MatrixForm

betas = s/.Solve[s==0,s]

Transpose[Ps]

PsTV={{1,0,0,0,0},{0,1,0,0,0},{0,0,(s^2) (1+s),0,0},{0,0,s (2+s),2+s,-1}}

{SqTV,{UqTV,VqTV}} = PolynomialSmithForm[PsTV,s];

SqTV//MatrixForm

gammas = s/.Solve[(s^2)+(s^3)==0,s]

PsT=PsTU//Transpose //Most//Transpose

{SqT,{UqT,VqT}} = PolynomialSmithForm[PsT,s];

SqT//MatrixForm

etas=s/.Solve[2 (s^2)+3 (s^3)+(s^4)==0,s]

(* Removing the betais *)