Exclusive or is a logical operation that outputs true only when inputs differ(one is true, the other is false). It is symbolized by the infix operators such as XOR,

.
This time, brave QQQ raises a problem to you. Given an interval [l, r], you need to calculate how many numbers x between l and r, where x satisfies

.
输入描述:
The first line contains an integer number T, the number of test cases.
of each next T lines contains two integers l, r(
).
输出描述:
For each test case print the answer.