Thiago is a poor farmer of the small village Khaldas, in ancient Egypt. Like it was common at that time, he needs to make an offering to Sun's god Rárada, also known as Ra. He needs to offer part of his harvest to show his gratefulness.
For this, Thiago will use baskets with capacity of $$$A$$$ grams of food. The total quantity of food must respect the following rules, as to not make Rá angry:
Help Thiago to find some quantity of food (in grams) that he must offer to god Rá. Notice that this quantity must be less than $$$10^{18}$$$ that is the productive capacity of this poor farmer.
The first line contains an integer $$$t$$$ ($$$1 \leq t \leq 10^5$$$) - the number of test cases. Then, $$$t$$$ lines follow.
Each line contains two space separated integers $$$A, B$$$ ($$$ 1 \leq A, B \lt 10^9$$$).
For each test case, print only one integer, the answer for the problem.
3102 107 21000 3
102 21 3000