setrow(A,i,b):=block([j],for j:1 while j<=length(col(A,1)) do A[i,j]:b[1,j],return(A))$
setcol(A,j,b):=block([i],for i:1 while i<=length(col(A,1)) do A[i,j]:b[i,1],return(A))$

n:3$
A:genmatrix(a,n,n);
B:genmatrix(b,n,1);
d:determinant(A);
makelist(setcol(copymatrix(A),i,B),i,1,n);
x:transpose(map(determinant,%)/d);
A.x$ ratsimp(%);

M[i,j]:=minor(A,i,j)$
genmatrix(M,n,n);
genmatrix(lambda([i,j],(-1)^(i+j)*determinant(M[i,j])),n,n);
transpose(%).A$
map(lambda([x],ratsimp(x/d)),%);