Iterative deletion and the median-voter theorem