eig[A_]:=(
B=A.Transpose[A];
{vals,vecs}=Eigensystem[B];
inverseEigenValuesMatrix=Table[Table[If[j==i,(vals[[i]])^(-1),0],{j,1,Length[vals]}],{i,1,Length[vals]}];
inverseMatrixB=Transpose[vecs].inverseEigenValuesMatrix.Inverse[Transpose[vecs]];
Print["det((B^(-1))) = ",1/Apply[Times,vals]];
Print[MatrixForm[inverseMatrixB]];
(* {inverseMatrixB,1/Apply[Times,vals]} (* връща списък *) *)
)