Sort the list before splitting it.