lexicographic scan