Stability of jurisdiction structures under the equal share and median rules