sort stack with at most one additional stack