Gennady is an aspiring programmer. He is currently learning the Euclidean algorithm for computing the greatest common divisor of two positive integers.
Unfortunately, Gennady sometimes confuses the integer division operator (denoted by div) with the remainder operator (denoted by mod). As an example, 37 div 10=3 and 37 mod 10=7.
Here's Gennady's latest implementation of the Euclidean algorithm:
\begin{itemize}
div $y$, then swap $x$ and $y$.As you can see, if Gennady used the mod operator instead of the div operator, his implementation would be correct: the algorithm above would successfully find the greatest common divisor of x and y. However, it turns out that even with this nasty bug the algorithm sometimes works correctly!
You are given an integer n. Gennady is interested in finding all input pairs (x,y) such that 1≤x,y≤n, the algorithm finishes, and produces the correct output. Let (x_1,y_1),(x_2,y_2),…,(x_k,y_k) be all such pairs in lexicographic order (for all 1≤i<k, either x_i<x_i+1, or x_i=x_i+1 and y_i<y_i+1).
You are also given q queries. Query i is a positive integer p_i, and you should print x_p_i and y_p_i, or report that p_i>k.
The first line contains two integers n and q --- the upper bound on the input values and the number of queries (1≤n,q≤2⋅105).
Each of the next q lines contains a single integer p_i (1≤p_i≤n2).
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 -1 -1 if there are less than p_i such pairs.