For the lattice of stable matchings, this median can instead be taken element-wise, by assigning each doctor the median in the doctor's preferences of the three hospitals matched to that doctor in formula_5, formula_4, and formula_19 and similarly by assigning each hospital the median of the three doctors matched to it.