Assume
and
are disjoint. Suppose
and
,
,
,
. We would try
but this will not always work because of restrictions on where
,
,
, and
are defined.
Given any vector
, let
be the subvector of elements of
which are congruent to
mod
. Given any permutation
of
let
.
Let
Let
be a permutation which sorts
into nondescending order. Let
. Then
is nondescending for every
.
Assume
is a suitable origin such that
and
,
,
,
. Let
Let
and
. Assume
is nondescending for every
.
For any given
, plot the elements of
and
as a function of position. Call the resulting monotonic polygonal curves
and
. For example, we might get this picture:
To avoid
and
having elements in common as we apply
operators to
we may proceed left to right where
lies below
and right to left where
lies above or on
.
Let
be a permutation of
that in every plot of
and
for every
selects the elements of
from left to right where
lies below
and selects the elements of
from right to left where
lies above or on
. Then we should apply
operators to
in the order
,
,
. That is,
