Reverse iterators behave differently from regular iterators when swapping (regular iterators continue to point at the same elements, while reverse iterators do not), so instead use regular iterators with a negative step for shifting down.