semilinear: print sets in lexicographical order