(via http://blogs.msdn.com/betsya/archive/2006/01/10/511451.aspx)
http://en.wikipedia.org/wiki/Stable_marriage_problem