D. Coprime
time limit per test
2 seconds
memory limit per test
1024 megabytes
input
standard input
output
standard output

You are given $$$2$$$ positive integers $$$x$$$, $$$y$$$, and your task is to find a positive integer $$$z$$$ which satisfies:

  • $$$x \lt z \lt y$$$.
  • $$$\gcd(z,y)=1$$$ and $$$\gcd(z,x)=1$$$.
If there are multiple answers, you can output any. If there is no valid $$$z$$$, output $$$-1$$$.
Input

The first line contains the number of testcases $$$T$$$ ($$$1 \le T \le 10^4$$$).

For each testcase,

The first and only line contains two integers $$$x$$$ and $$$y$$$ ($$$1 \le x,y \le 10^{10},x+2 \le y$$$).

Output

For each testcase, if the answer exists, output your answer in one line. Otherwise, output $$$-1$$$.

Example
Input
3
1 3
115 125
2184 2200
Output
2
117
-1