lexicographic_sort