Sort marks according to the order they are recorded.