For each 3rd component which occurs in the list, remove all but the last element with that 3rd component.
The type of list elements.
A list.
A list containing all ordered pairs of elements of xs, excluding the diagonal.
all lists obtainable by concatenating one from s1 with one from s2