C. Alyona Loves Ranges
time limit per test
1 second
memory limit per test
256 megabytes
input
standard input
output
standard output

Alyona always plays with the numbers and the numbers that are between two numbers. Alyona's teacher notices this and gives her a mini assessment.

The teacher gives her three numbers $$$n$$$, $$$l$$$, and $$$r$$$ ($$$l \le r$$$). Alyona has to find the minimum integer $$$x$$$ such that:

  • $$$x \in [l,r]$$$.
  • $$$\gcd(n,x) \in [l,r]$$$.

Here $$$\operatorname{gcd}$$$ denotes the greatest common divisor.

If there is no such integer $$$x$$$, output $$$-1$$$ instead.

Input

The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 10^3$$$).

The only line of each test case contains three integers $$$n$$$, $$$l$$$, and $$$r$$$ ($$$1 \le n \le 10^9$$$, $$$1 \le l \le r \le 10^9$$$).

Output

For each test case, output an integer — the minimum integer $$$x$$$ satisfying the conditions above. If there is no such integer $$$x$$$, output $$$-1$$$ instead.

Example
Input
3
6 5 7
10 1 10
2 3 4
Output
6
1
-1
Note

In the first test case, the smallest integer in the range $$$[5, 7]$$$ is $$$5$$$. However, $$$\gcd(6, 5) = 1$$$, which is not in $$$[5, 7]$$$. Next, for $$$x = 6$$$, $$$\gcd(6, 6) = 6$$$, which is in $$$[5, 7]$$$. Therefore, the answer is $$$6$$$.