Solve for s q=r+rst