This is the meaning of stable in the stable marriage problem. And the Gale-Shapley algorithm does this.