Printing lexically ordered lists properly