sort markups with equal indexes