Characterizing lexicographic preferences