program marriage (WifeOf[]); begin n = 5; some w; w = 0; do n times { marry off the women one by one } begin w >> w0 = w0 + 1; find m in [1 .. n] with begin b[m] = 1; { m is still a bachelor } w = WifeOf[m]; { propose woman w to man m } some b[m]; b[m] = 0; { m is no bachelor anymore } end end end