Crucial bug-fix to lca_query: get the representative element THEN check the order.
u < v does not imply R[u] < R[v].