That, unfortunately, isn't always possible. Sorting a list of people by their names alphabetically is a fairly reasonable thing to ask and in many places, it is expected that names will be sorted the surname, whether or not it appears first. This by itself requires breaking rules 18 and 20, but we may not be able to opt not to do it.
The hard problem is not what to do in the ideal case: the hard problem is figuring out how to handle names in a way that minimizes friction if requirements force us to make some such assumptions.