Let $\text{ctz}(x)$ be the number of trailing zeros in the binary representation of $x$, for example, $\text{ctz}(1001000_2)=3$.
Let $\text{ppc}(x)$ be the number of ones in the binary representation of $x$, for example, $\text{ppc}(1001000_2)=2$.
A number is defined as a "good number" if and only if $\text{ctz}(x)=\text{ppc}(x)$.
Given $Q$, there are $Q$ queries. Each query provides an interval $[l,r]$, and you need to find any good number in $[l,r]$, or determine that no such number exists.
Input
The first line contains a positive integer $Q$.
Each of the next $Q$ lines contains two positive integers $l$ and $r$.
Output
For each query, output one line. If there exists a good number in the interval $[l,r]$, output any such good number; otherwise, output $-1$.
Examples
Input 1
5 38 47 57 86 23 24 72 83 32 33
Output 1
-1 68 -1 -1 -1
Input 2
See the provided files.
Output 2
See the provided files.
Constraints
This problem uses bundled subtasks.
For all data, it is guaranteed that $1\le Q\le 10^5$ and $1\le l\le r\le 10^9$.
| Subtask ID | Special Properties | Score |
|---|---|---|
| $1$ | $1\le l\le r\le 10^7$ | $24$ |
| $2$ | $l,r$ are chosen randomly in $[1,10^9]$ | $34$ |
| $3$ | None | $42$ |