mekso (2 or 3)-ary operator: maximum/minimum/extreme element; ordered list of extreme elements of the set underlying ordered set/structure X_{1} in direction X_{2} of list length X_{3} (default: 1)

X_{1} must be an ordered set (or an ordered structure); extremeness is measured with respect to the order which endows the underlying set; the output is a list of elements of the underlying set. X_{2} accepts only -1 (li ni'upa) or +1 (li ma'upa); if the input to X_{2} is -1, then the type of extreme(ness) is lessness, so minimal elements are listed (starting from the least element in the underlying set according to its order); if the input to X_{2} is +1, then the type of extreme(ness) is greatness, so maximal elements are listed (starting from the greatest element in the underlying set according to the order which endows it); not even li ni'u nor li ma'u on their own are accepted in X_{2}.
All input for X_{3} must be a nonnegative and finite integer, ro, or countable infinity (ci'ino); nontrivial input for X_{3} must is a positive, finite natural number which is less than or equal to the cardinality of the set underlying X_{1}; submit "ro" for X_{3} in order to reproduce the underlying set as an ordered list (according to the order endowing the set) only if the underlying set is countable (finite or infinite) and discrete (has only isolated points); submit 0 for X_{3} in order to return the empty list; submit ci'ino in order to do the same as ro, but only if the set is countably infinite and is discrete (has only isolated points). If the set does not attain its supremum (if X_{2} = +1) or infimum (if X_{2} = -1), then the list is empty. Provided that the list is well-defined and nonempty, then the input of X_{3} can be augmented by +1 only if any interval around the last element of the list produced with the previous value of X_{3} which extends in the (-X_{2})-direction intersected with the set underlying X_{1} is either empty or has an (X_{2})-determined-extreme element which is isolated and there exists at least one nonempty interval. If the set underlying X_{1} is unbounded in the (X_{2})-determined direction, then the first extreme element is X_{2 × \infty}. This operator produces the first X_{3} most X_{2}-type-extreme elements of X_{1} in order starting from the very most extreme of that type. The type of the output is a list, not a number; its elements must be extracted in order to be treated as numbers; this is true even if the length of the list is 1. This function can be defined iteratively: Let ext be this function, denote set difference by "Exclude", denote set union by "Union", ith entry extraction from a list list by "list|_{i}" where the list starts at the first (i=1) entry list|_{1}, and set builder notation by Set (where the first input lists the dummy values and possibly their domain, and the second input (if present) contains an exhaustive list of the conditions restricting the dummy values); an ordered structure is denoted by "(A, <)", where A is the underlying set of the structure and '<' is the order which endows the structure. When it is well-defined (and the inputs, excluding m are fixed by context), denote z_{m }= -i × ext((A,<),i,n)|_{m}. Then ext((A,<),i,n) equals a list of length n wherein each entry is an element of A and if n>1, then for any natural number m_{m < -i×y < z}. Then, if it is well-defined, z_{m+1 }= ext((A Exclude (Set(z_{1)} Union ... Union Set(z_{m)),<),i,1)}.