410061: GYM103934 I Offering to god Ra
Description
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:
- All of the baskets must be full, so that Ra doesn't think Thiago is offering less food than he could
- Since Ra loves the number $$$B$$$, the total quantity of food (in grams) in decimal base must begin with the number $$$B$$$. For example, if $$$B=471$$$, the number $$$4715166$$$ accomplishes this rule, since $$$471$$$ is in its most significant digits.
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.
InputThe 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 < 10^9$$$).
OutputFor each test case, print only one integer, the answer for the problem.
ExampleInput3 102 10 7 2 1000 3Output
102 21 3000