Solve for A BA+C=D