Cirno has two integers $$$n$$$ and $$$m$$$, and she is counting the number of integer arrays $$$b = (b_1, b_2, \ldots, b_n)$$$ such that
Cirno does not want to deal with large numbers, so for each test case she only wants to know the answer modulo $$$2$$$.
$$$^{\text{∗}}$$$$$$\gcd(x, y)$$$ denotes the greatest common divisor (GCD) of integers $$$x$$$ and $$$y$$$.
Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 10^4$$$). The description of the test cases follows.
Each of the next $$$t$$$ lines contains two integers $$$n$$$ and $$$m$$$ ($$$1 \le n, m \le 5 \cdot 10^4$$$).
For each test case, output a single integer — the required count modulo $$$2$$$.
52 52 62 740000 5000030001 50000
11101
In the first test case ($$$n = 2$$$, $$$m = 5$$$), the valid arrays $$$b$$$ are $$$[1,2]$$$, $$$[1,3]$$$, $$$[1,4]$$$, $$$[1,5]$$$, $$$[2,3]$$$, $$$[2,5]$$$, $$$[3,4]$$$, $$$[3,5]$$$, $$$[4,5]$$$. There are $$$9$$$ of them, so the answer is $$$9 \bmod 2 = 1$$$.
In the second test case ($$$n = 2$$$, $$$m = 6$$$), the nine arrays listed above are valid, and so are $$$[1,6]$$$ and $$$[5,6]$$$. There are $$$11$$$ of them, so the answer is $$$1$$$.
In the third test case ($$$n = 2$$$, $$$m = 7$$$), the eleven arrays listed above are valid, and so are $$$[1,7]$$$, $$$[2,7]$$$, $$$[3,7]$$$, $$$[4,7]$$$, $$$[5,7]$$$, and $$$[6,7]$$$. There are $$$17$$$ of them, so the answer is $$$1$$$.