##### ###### ##### ### # # ### # # ###### ## ## ## ## ## ## ## # # # # # ## ##### #### ##### # # # # # # # #### ## # ## ## ## ## # # # # # ## ## # ###### ## ### # ### # ######
##### ###### ##### ### # # ### # # ###### ## ## ## ## ## ## ## # # # # # ## ##### #### ##### # # # # # # # #### ## # ## ## ## ## # # # # # ## ## # ###### ## ### # ### # ######
##### ###### ##### ### # # ### # # ###### ## ## ## ## ## ## ## # # # # # ## ##### #### ##### # # # # # # # #### ## # ## ## ## ## # # # # # ## ## # ###### ## ### # ### # ######
We can find the relative value of every three indices by asking one query. That means, when we have three indices ; we can find the order of by asking one query.
How?
If we ask these three indices as a query, we will receive the index such that equals their median value and the specified flag s.
We can see that any order of will be different in this two values (3 is the bigger one, 2 is the median and 1 is the smaller one):
the order of
the order of
the order of
the order of
the order of
the order of
So we can find their order by receiving these two values.