Stable marriage problem