For each query, print two integers. These integers must either be $x_{p_i}$ and $y_{p_i}$, denoting the $p_i$-th input pair in lexicographic order such that the algorithm finishes and produces a correct output, or \t{-1 -1} if there are less than $p_i$ such pairs.